[Mono-bugs] [Bug 74840][Maj] Changed - Blocking Read() does not return if NetworkStream is closed underneath it

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 9 May 2005 15:45:24 -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=74840

--- shadow/74840	2005-05-09 14:11:47.000000000 -0400
+++ shadow/74840.tmp.7862	2005-05-09 15:45:24.000000000 -0400
@@ -91,6 +91,13 @@
 
 What are my alternatives here?  I'd rather not do async IO, since each
 connection is being handled by its own thread and I don't need the
 added complexity.  Can I do a Thread.Abort() on that thread after
 closing the socket?  Will that cause the Read() to end?  What would
 you recommend?
+
+------- Additional Comments From gonzalo@ximian.com  2005-05-09 15:45 -------
+I agree, this is broken.
+
+As to the 'workaround' I would either abort the thread or have a timed
+Poll + socket.Available check. If Poll returns true and sock.Available
+is 0, the socket is closed.