private Exception AttemptUserConnection()
{
Debug.Assert(!SocketPal.SupportsMultipleConnectAttempts);
Debug.Assert(_lastAttemptSocket != null);
try
{
_lastAttemptSocket.Dispose();
// Setup the internal args. RemoteEndpoint should already be correct.
_internalArgs.SetBuffer(_userArgs.Buffer, _userArgs.Offset, _userArgs.Count);
return AttemptConnection(UserSocket, _internalArgs);
}
catch (Exception e)
{
if (e is ObjectDisposedException)
{
NetEventSource.Fail(this, "unexpected ObjectDisposedException");
}
return e;
}
}