From b48b443f6c4585fa6073e475eb24b101540692c0 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Tue, 26 Apr 2011 11:01:41 -0400 Subject: [PATCH] Reset the blocking flag as soon as possible. --- mcs/class/System/System.Net.Sockets/Socket.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mcs/class/System/System.Net.Sockets/Socket.cs b/mcs/class/System/System.Net.Sockets/Socket.cs index fdfbc9614d8..5844cb9374a 100644 --- a/mcs/class/System/System.Net.Sockets/Socket.cs +++ b/mcs/class/System/System.Net.Sockets/Socket.cs @@ -691,14 +691,13 @@ namespace System.Net.Sockets bool blk = blocking; if (blk) Blocking = false; - SocketAddress serial = end_point.Serialize (); Connect_internal (socket, serial, out error); + if (blk) + Blocking = true; if (error == 0) { // succeeded synch connected = true; - if (blk) - Blocking = true; req.Complete (true); return req; } @@ -706,16 +705,12 @@ namespace System.Net.Sockets if (error != (int) SocketError.InProgress && error != (int) SocketError.WouldBlock) { // error synch connected = false; - if (blk) - Blocking = true; req.Complete (new SocketException (error), true); return req; } // continue asynch connected = false; - if (blk) - Blocking = true; socket_pool_queue (Worker.Dispatcher, req); return(req); } -- 2.25.1