[Mono-bugs] [Bug 74842][Maj] Changed - Stopping a listener doesn't break out of an AcceptSocket() call

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 6 May 2005 04:56:18 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by gonzalo@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=74842

--- shadow/74842	2005-05-06 04:51:51.000000000 -0400
+++ shadow/74842.tmp.3715	2005-05-06 04:56:18.000000000 -0400
@@ -53,6 +53,23 @@
 (SocketExcepetion -> A blocking operation was interrupted by a call to
 WSACancelBlockingCall)
 
 On windows Mono runtime I get the same but the text of the exception
 is "interrupted"
 
+
+------- Additional Comments From gonzalo@ximian.com  2005-05-06 04:56 -------
+Seems like closing the socket while it's waiting on accept() does not
+make accept() fail.
+
+If I implement Accept in terms of Begin/EndAccept, it works with epoll
+and fails with poll.
+
+I also tried calling poll with -1 timeout just before accept() and the
+call never returns.
+
+So the only option left is poll() + timeout before accept(), which
+works fine but is subject to race conditions if someone else opens
+after we close this socket.
+
+I'm going to keep try a decent solution, if not, i guess poll()+a
+short timeout is going to be it.