소스 검색

2008-12-30 Bill Holmes <[email protected]>

	* socket-io.h : Changing the signature of
	  ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
	  the blocking state.

	* icall-def.h :  Changing the signature of
	  System.Net.Sockets.Socket.Accept_internal to pass the blocking state.

	* socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
	  For Windows only.  Avoid blocking when calling accept by
	  querying for a connection via select.  The loop also queries
	  the thread state every 1000 micro seconds for the thread
	  stop state.  This will avoid the process hanging on shutdown
	  when using a TcpChannel that is never connected to.

	* Socket.cs (Accept_internal) :  Changing the signature to pass
	  the blocking state.
	  
	Code is contributed under MIT/X11 license.


svn path=/trunk/mcs/; revision=122252
Bill Holmes 17 년 전
부모
커밋
b5dde2bbdc
2개의 변경된 파일10개의 추가작업 그리고 3개의 파일을 삭제
  1. 7 0
      mcs/class/System/System.Net.Sockets/ChangeLog
  2. 3 3
      mcs/class/System/System.Net.Sockets/Socket.cs

+ 7 - 0
mcs/class/System/System.Net.Sockets/ChangeLog

@@ -1,3 +1,10 @@
+2008-12-30  Bill Holmes  <[email protected]>
+
+	* Socket.cs (Accept_internal) :  Changing the signature to pass 
+	  the blocking state.
+
+	Code is contributed under MIT/X11 license.
+
 2008-12-20  Miguel de Icaza  <[email protected]>
 
 	* SocketException.cs: Add missing API.

+ 3 - 3
mcs/class/System/System.Net.Sockets/Socket.cs

@@ -1381,7 +1381,7 @@ namespace System.Net.Sockets
 		
 		// Creates a new system socket, returning the handle
 		[MethodImplAttribute(MethodImplOptions.InternalCall)]
-		private extern static IntPtr Accept_internal(IntPtr sock, out int error);
+		private extern static IntPtr Accept_internal(IntPtr sock, out int error, bool blocking);
 
 		Thread blocking_thread;
 		public Socket Accept() {
@@ -1392,7 +1392,7 @@ namespace System.Net.Sockets
 			IntPtr sock = (IntPtr) (-1);
 			blocking_thread = Thread.CurrentThread;
 			try {
-				sock = Accept_internal(socket, out error);
+				sock = Accept_internal(socket, out error, blocking);
 			} catch (ThreadAbortException) {
 				if (disposed) {
 #if !NET_2_1
@@ -1425,7 +1425,7 @@ namespace System.Net.Sockets
 			blocking_thread = Thread.CurrentThread;
 			
 			try {
-				sock = Accept_internal (socket, out error);
+				sock = Accept_internal (socket, out error, blocking);
 			} catch (ThreadAbortException) {
 				if (disposed) {
 #if !NET_2_1