[Mono-bugs] [Bug 54011][Min] New - Some sort of w32 error at normal exit of xsp

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 7 Feb 2004 01:52:57 -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=54011

--- shadow/54011	2004-02-07 01:52:57.000000000 -0500
+++ shadow/54011.tmp.15483	2004-02-07 01:52:57.000000000 -0500
@@ -0,0 +1,61 @@
+Bug#: 54011
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 008 One day
+Priority: Minor
+Component: System
+AssignedTo: gonzalo@ximian.com                            
+ReportedBy: liyul@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Some sort of w32 error at normal exit of xsp
+
+C:\mono-0.30>xsp
+Listening on port: 8080
+Listening on address: 0.0.0.0
+Root directory: C:\mono-0.30
+Hit Return to stop the server.
+
+<hit return after some work>
+
+Unhandled Exception: System.Net.Sockets.SocketException: Some sort of w32 error
+occurred: 0
+in (unmanaged) (wrapper managed-to-native)
+System.Net.Sockets.Socket:Accept_inte
+rnal (intptr)
+in <0x00004> (wrapper managed-to-native)
+System.Net.Sockets.Socket:Accept_intern
+al (intptr)
+in <0x0005d> System.Net.Sockets.Socket:Accept ()
+in <0x0002f> Mono.ASPNET.XSPApplicationServer:RunServer ()
+in <0x0003e> (wrapper delegate-invoke) System.MulticastDelegate:invoke_void ()
+
+
+C:\mono-0.30>
+
+gdb indicate a WSAEINTR for this normal exit at
+ves_icall_System_Net_Sockets_Socket_Accept_internal
+The error message is annoying though. Quick fix:
+
+gpointer ves_icall_System_Net_Sockets_Socket_Accept_internal(SOCKET sock)
+{
+	SOCKET newsock;
+	
+	MONO_ARCH_SAVE_REGS;
+
+	newsock = _wapi_accept (sock, NULL, 0);
+	if(newsock==INVALID_SOCKET) {
+		int iRes=WSAGetLastError();
+		if (iRes && WSAEINTR!=iRes)	// normal exit (?)
+			mono_raise_exception(get_socket_exception(iRes));
+		return(NULL);
+	}
+	
+	return(GUINT_TO_POINTER (newsock));
+}