Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2004-05-04 00:10:59 +0400
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2004-05-04 00:10:59 +0400
commit48b65204d4a2387a9da92ecb3f91afecca8589d7 (patch)
tree2c4e379f9ad6d93409578b58efa2cea91636b74a /mcs/class/System/System.Net.Sockets
parent3664d705e28990d0b46a33bd50dadfc14f070278 (diff)
2004-05-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Socket.cs: fix for BeginConnect and non-blocking sockets. svn path=/trunk/mcs/; revision=26636
Diffstat (limited to 'mcs/class/System/System.Net.Sockets')
-rw-r--r--mcs/class/System/System.Net.Sockets/ChangeLog4
-rw-r--r--mcs/class/System/System.Net.Sockets/Socket.cs16
2 files changed, 17 insertions, 3 deletions
diff --git a/mcs/class/System/System.Net.Sockets/ChangeLog b/mcs/class/System/System.Net.Sockets/ChangeLog
index ae8e82ce52d..3d500209970 100644
--- a/mcs/class/System/System.Net.Sockets/ChangeLog
+++ b/mcs/class/System/System.Net.Sockets/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Socket.cs: fix for BeginConnect and non-blocking sockets.
+
2004-05-03 Lluis Sanchez Gual <lluis@ximian.com>
* Socket.cs: Use assembly name const to load Mono.Posix.
diff --git a/mcs/class/System/System.Net.Sockets/Socket.cs b/mcs/class/System/System.Net.Sockets/Socket.cs
index 6c91f6b31fc..fdcdfd4cdbf 100644
--- a/mcs/class/System/System.Net.Sockets/Socket.cs
+++ b/mcs/class/System/System.Net.Sockets/Socket.cs
@@ -186,10 +186,20 @@ namespace System.Net.Sockets
{
lock (result) {
try {
- if (!result.Sock.blocking)
- result.Sock.Poll (-1, SelectMode.SelectWrite);
-
result.Sock.Connect (result.EndPoint);
+ } catch (SocketException se) {
+ if (result.Sock.blocking || se.ErrorCode != 10036) {
+ result.Complete (se);
+ return;
+ }
+
+ try {
+ result.Sock.Poll (-1, SelectMode.SelectWrite);
+ result.Sock.Connect (result.EndPoint);
+ } catch (Exception k) {
+ result.Complete (k);
+ return;
+ }
} catch (Exception e) {
result.Complete (e);
return;