Imported Upstream version 6.8.0.73

Former-commit-id: d18deab1b47cfd3ad8cba82b3f37d00eec2170af
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-12-10 18:00:56 +00:00
parent bceda29824
commit 73ee7591e8
1043 changed files with 16271 additions and 22080 deletions

View File

@ -166,7 +166,21 @@ namespace System.Net
} else {
try {
operation.ThrowIfDisposed (cancellationToken);
await socket.ConnectAsync (remote).ConfigureAwait (false);
/*
* Socket.Tasks.cs from CoreFX introduces a new internal
* BeginConnect(EndPoint) overload, which will replace
* the one we're using from SocketTaskExtensions.cs.
*
* Our implementation of Socket.BeginConnect() does not
* invoke the callback when the request failed synchronously.
*
* Explicitly use our implementation from SocketTaskExtensions.cs here.
*/
await Task.Factory.FromAsync (
(targetEndPoint, callback, state) => ((Socket)state).BeginConnect (targetEndPoint, callback, state),
asyncResult => ((Socket)asyncResult.AsyncState).EndConnect (asyncResult),
remote, socket).ConfigureAwait (false);
} catch (ObjectDisposedException) {
throw;
} catch (Exception exc) {