http://bugs.winehq.org/show_bug.cgi?id=9787
Scott Lindeneau slindeneau@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #15080|0 |1 is obsolete| |
--- Comment #237 from Scott Lindeneau slindeneau@gmail.com 2008-07-29 13:04:30 --- Created an attachment (id=15164) --> (http://bugs.winehq.org/attachment.cgi?id=15164) AcceptEx General Patch - No data_length support
(In reply to comment #236) Thank you for your trace. It helped me isolate the situation with closing sockets. (In reply to comment #232) I have resolved this issue. Thank you for your log, it was helpful.
(In reply to comment #234) Thanks, fixed.
A big thank you to Andrey Turkin. Without your help I would never have gotten very far. Much of the original code for the patch came from Andrey, if you want someone to thank, thank him.
As for this patch, some notes: The problem with both my first patch and second patch attempt, and I believe part of the problem with Andrey's second patch, deals with the book keeping that is done by the wineserver core. Asynchronous I/O necessitates that multi-threading happen. With the AcceptEx this is particularly tricky, because we have to keep track of two different sockets, that are doing different things. Our async queue is on the listening socket, but when the accepting socket is closed (without accepting a connection) the async queue needs to be updated to remove that socket from the listening socket's listening queue. This is where all of the "missing connections" went. We were accepting connections to sockets the host program thought it had closed. (This also caused all kinds of deadlocking issues in the background). Thus, a socket (or well, anything that is asynchronous) needs to know how to locate and destroy the async request that we are a part of, but we are not waiting on. (We wait on the listening socket, but we are not listening).
That being said, this patch does not solve all of the issues. I believe it solves the issues mentioned, but it doesn't solve all of the order/out of order problems. I just can't figure them all out.