[Mono-bugs] [Bug 70836][Nor] New - Poll Times out on Sockets which have been closed

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 28 Dec 2004 01:08:03 -0500 (EST)


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 scott@imeem.com.

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

--- shadow/70836	2004-12-28 01:08:03.000000000 -0500
+++ shadow/70836.tmp.1214	2004-12-28 01:08:03.000000000 -0500
@@ -0,0 +1,50 @@
+Bug#: 70836
+Product: Mono: Class Libraries
+Version: 1.1
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: scott@imeem.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Poll Times out on Sockets which have been closed
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+If you perform a socket.Poll(timeout,SelectMode.SelectRead) on a socket
+which has been closed by the remote server the poll will wait for the full
+duration of the timeout before returning false. When this is attempted with
+the .Net implementation the Poll returns immediately if the remote socket
+is already closed. Note: the socket.Connected property will be unaffected
+by a Poll.
+
+Steps to reproduce the problem:
+1. Create a socket object and Connect it to a server, sleep for a while
+2. The remote server should close the socket 
+3. despite the remote end being closed the Socket.Connected property will
+still return true (this what .Net does)
+4. Perform Socket.Poll() with a non zero timeout
+(5. after the poll returns false the Socket.Connected property will still
+return true)
+
+Actual Results:
+On mono the Poll will wait for the full timeout to elapse before returning
+false
+
+Expected Results:
+On .Net the Poll will return false immediately.
+
+How often does this happen? 
+Always
+
+Additional Information:
+I only tested this with SelectMode.SelectRead - the .Net behaviour should
+be replicated for all SelectModes.