[Mono-bugs] [Bug 80211][Wis] Changed - SocketOptionName.ReuseAddress doesn't work on Linux

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Dec 9 23:08:11 EST 2006


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 cikki.mukki at gmail.com.

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

--- shadow/80211	2006-12-09 23:07:18.000000000 -0500
+++ shadow/80211.tmp.25531	2006-12-09 23:08:11.000000000 -0500
@@ -50,6 +50,30 @@
 suggestions how/where to fix/patch is appreciated.
 
 ------- Additional Comments From Cikki.Mukki at gmail.com  2006-12-09 23:07 -------
 Created an attachment (id=18257)
 Source code to repro problem
 
+
+------- Additional Comments From Cikki.Mukki at gmail.com  2006-12-09 23:08 -------
+                Socket listenSocket = new Socket(
+                    AddressFamily.InterNetwork, SocketType.Stream,
+ProtocolType.Tcp);
+                listenSocket.SetSocketOption(SocketOptionLevel.Socket,
+                                            
+SocketOptionName.ReuseAddress, 1);
+                listenSocket.Bind(new IPEndPoint(IPAddress.Any, 0));
+                listenSocket.Listen(5);
+		IPEndPoint ipe = (IPEndPoint) listenSocket.LocalEndPoint;
+		int port = ipe.Port;
+                Console.WriteLine("Listening on {0}..", port);
+
+                Socket connectSocket = new Socket(
+                    AddressFamily.InterNetwork, SocketType.Stream,
+ProtocolType.Tcp);
+                connectSocket.SetSocketOption(SocketOptionLevel.Socket,
+                                            
+SocketOptionName.ReuseAddress, 1);
+                connectSocket.Bind(new IPEndPoint(IPAddress.Any, port));
+                //connectSocket.Connect(new IPEndPoint("65.34.23.23",
+80));
+                Console.WriteLine("Connect done.");


More information about the mono-bugs mailing list