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

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs')
-rw-r--r--src/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs b/src/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs
index 5a3d9f897e..c9c5afa7d0 100644
--- a/src/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs
+++ b/src/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs
@@ -187,6 +187,15 @@ namespace System.Net.Sockets
// Keep track of this because it will be overwritten by AttemptConnection
SocketError currentFailure = args.SocketError;
+#if MONO
+ // Make sure we're always resetting the Mono-specific `in_progress` field when
+ // re-attempting a connection.
+ // If a previous connection failed asynchronously, then it will already have been
+ // resetted, but not on synchronous connection failures (such as for instance, the
+ // host not supporting IPv6 or the network being down).
+ // This should fix https://github.com/mono/mono/issues/18030.
+ args.in_progress = 0;
+#endif
Exception connectException = AttemptConnection();
if (connectException == null)