[Mono-bugs] [Bug 75154][Nor] New - Socket.Connect does not report error for IPAddress.Any remote endpoint

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Jun 4 09:40:17 EDT 2005


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 gert.driesen at pandora.be.

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

--- shadow/75154	2005-06-04 09:40:17.000000000 -0400
+++ shadow/75154.tmp.4299	2005-06-04 09:40:17.000000000 -0400
@@ -0,0 +1,60 @@
+Bug#: 75154
+Product: Mono: Class Libraries
+Version: 1.1
+OS: GNU/Linux [Other]
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Socket.Connect does not report error for IPAddress.Any remote endpoint
+
+When a remote endpoint with IPAddress.Any is passed to Socket.Connect (), 
+Mono should throw a SocketException with ErrorCode 10049 ("The requested 
+address is not valid in this context").
+
+Note: this is working fine on Windows (both Mono and MS.NET)
+
+To reproduce this issue, compile and execute the following code snippet:
+
+using System;
+using System.Net;
+using System.Net.Sockets;
+
+public class EntryPoint {
+  public static void Main() {
+    IPEndPoint ep = new IPEndPoint(IPAddress.Any, 0); 
+
+    try {
+      using (Socket conn1 = new Socket (AddressFamily.InterNetwork,
+                                SocketType.Dgram, ProtocolType.Udp)) {
+        conn1.Connect (ep); 
+	conn1.Close ();
+      }
+      Console.WriteLine("#1: Should've failed");
+    } catch (SocketException ex) {
+      if (ex.ErrorCode != 10049) {
+        Console.WriteLine ("#2: " +ex.ErrorCode + " -> " + 
+                          ex.ToString ());
+      }
+    }
+  }
+}
+
+Actual result:
+
+#1: Should've failed
+
+Expected result:
+
+No output
+
+I'll commit a (ignored) unit test for this issue in SocketTest.cs later 
+today.


More information about the mono-bugs mailing list