private Exception AttemptConnection()
{
try
{
IPAddress attemptAddress = GetNextAddress(out _lastAttemptSocket);
if (attemptAddress == null)
{
return new SocketException((int)SocketError.NoData);
}
if (attemptAddress == null)
{
NetEventSource.Fail(this, "attemptAddress is null!");
}
_internalArgs.RemoteEndPoint = new IPEndPoint(attemptAddress, _endPoint.Port);
return AttemptConnection(_lastAttemptSocket, _internalArgs);
}
catch (Exception e)
{
if (e is ObjectDisposedException)
{
NetEventSource.Fail(this, "unexpected ObjectDisposedException");
}
return e;
}
}