Imported Upstream version 5.8.0.108

Former-commit-id: aa718e56e7949f19a33e4f0baefe3d1ea1dea22c
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-01-19 16:41:39 +00:00
parent 5fb0d61fc6
commit 88ff76fe28
44 changed files with 137 additions and 66 deletions

View File

@ -249,12 +249,22 @@ namespace System.Net.Sockets
internal void FinishConnectByNameSyncFailure (Exception exception, int bytesTransferred, SocketFlags flags)
{
throw new NotImplementedException ();
SetResults (exception, bytesTransferred, flags);
if (current_socket != null)
current_socket.is_connected = false;
Complete ();
}
internal void FinishOperationAsyncFailure (Exception exception, int bytesTransferred, SocketFlags flags)
{
throw new NotImplementedException ();
SetResults (exception, bytesTransferred, flags);
if (current_socket != null)
current_socket.is_connected = false;
Complete ();
}
internal void FinishWrapperConnectSuccess (Socket connectSocket, int bytesTransferred, SocketFlags flags)
@ -268,8 +278,29 @@ namespace System.Net.Sockets
internal void SetResults (SocketError socketError, int bytesTransferred, SocketFlags flags)
{
SocketError = socketError;
ConnectByNameError = null;
BytesTransferred = bytesTransferred;
SocketFlags = flags;
}
internal void SetResults (Exception exception, int bytesTransferred, SocketFlags flags)
{
ConnectByNameError = exception;
BytesTransferred = bytesTransferred;
SocketFlags = flags;
if (exception == null)
{
SocketError = SocketError.Success;
}
else
{
var socketException = exception as SocketException;
if (socketException != null)
SocketError = socketException.SocketErrorCode;
else
SocketError = SocketError.SocketError;
}
}
}
}