[Mono-bugs] [Bug 35371][Nor] Changed - Setting ReceiveTimeout causes exception

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sat, 31 May 2003 07:18:32 -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 groith@tcrz.net.

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

--- shadow/35371	Wed Dec 11 10:32:52 2002
+++ shadow/35371.tmp.20013	Sat May 31 07:18:32 2003
@@ -1,13 +1,13 @@
 Bug#: 35371
 Product: Mono/Class Libraries
 Version: unspecified
 OS: Red Hat 7.1
 OS Details: 
-Status: RESOLVED   
-Resolution: WONTFIX
+Status: REOPENED   
+Resolution: 
 Severity: Unknown
 Priority: Normal
 Component: System
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: richard@phpguru.org               
 QAContact: mono-bugs@ximian.com
@@ -82,6 +82,36 @@
 still better than having the application die.
 
 ------- Additional Comments From dick@ximian.com  2002-12-11 10:32 -------
 pretty much any SetSocketOption has the potential to generate EINVAL.
  I suppose the TcpClient wrapper could have some workarounds for this
 particular one though.
+
+------- Additional Comments From groith@tcrz.net  2003-05-31 07:18 -------
+TimeOut cannot be set. If the exception, raised by the second line is
+catched, ReceiveFrom will never timeout.
+
+        Socket PingSocket = new Socket(AddressFamily.InterNetwork,
+SocketType.Raw, ProtocolType.Icmp);
+
+try {
+        PingSocket.SetSocketOption( SocketOptionLevel.Socket,
+SocketOptionName.ReceiveTimeout, (int) lngPingTimeout);
+}
+catch {}
+
+
+        try 
+
+         {
+           iBytesReceived = PingSocket.ReceiveFrom(ReceiveBuffer,
+MAX_PACKET_SIZE, SocketFlags.None, ref EndPointFrom);
+
+         }
+
+         catch //(Exception e)
+
+         {
+
+          Console.WriteLine ("Request timed out.");
+
+         }