[Mono-bugs] [Bug 53992][Nor] Changed - SocketException not normally thrown for reusing server socket address
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sat, 7 Feb 2004 01:10:20 -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 liyul@hotmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=53992
--- shadow/53992 2004-02-06 16:09:19.000000000 -0500
+++ shadow/53992.tmp.15000 2004-02-07 01:10:20.000000000 -0500
@@ -1,17 +1,17 @@
Bug#: 53992
Product: Mono/Class Libraries
Version: unspecified
-OS:
+OS: All
OS Details:
Status: NEW
Resolution:
-Severity:
-Priority: Wishlist
+Severity: 008 One day
+Priority: Normal
Component: System
-AssignedTo: mono-bugs@ximian.com
+AssignedTo: gonzalo@ximian.com
ReportedBy: liyul@hotmail.com
QAContact: mono-bugs@ximian.com
TargetMilestone: ---
URL:
Cc:
Summary: SocketException not normally thrown for reusing server socket address
@@ -38,6 +38,39 @@
Listening on address: 0.0.0.0
Root directory: E:\work\mono-0.30\xsp\server\bin\Debug
Hit Return to stop the server.
Bot implementations indicated the socket address is
(InterNetwork/0.0.0.0/80) and this port was in use by IIS already at the time.
+
+------- Additional Comments From liyul@hotmail.com 2004-02-07 01:10 -------
+The related bug was 36322, which was fixed. First fix is in mono
+socket-io.c function
+ves_icall_System_Net_Sockets_Socket_Socket_internal, remove code block
+(commented out here)
+
+ // if (sock_family == AF_INET && sock_type == SOCK_DGRAM) {
+ // return (GUINT_TO_POINTER (sock));
+ // }
+
+#ifdef AF_INET6
+ // if (sock_family == AF_INET6 && sock_type == SOCK_DGRAM) {
+ // return (GUINT_TO_POINTER (sock));
+ // }
+#endif
+
+ /* .net seems to set this by default for SOCK_STREAM,
+ * not for SOCK_DGRAM (see bug #36322)
+ */
+ // ret = _wapi_setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, &true,
+sizeof (true));
+ // if(ret==SOCKET_ERROR) {
+ // closesocket(sock);
+ // mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ // return(NULL);
+ // }
+
+so that creating duplicate socket will fail as normal expected.
+
+There also need to be work in class library to capture correct error
+number and throw the appropriate error message rather than saying
+Error: Some sort of w32 error occurred: 0.