System.Net.Sockets.MultipleConnectAsync.AttemptConnection C# (CSharp) Method

AttemptConnection() private static method

private static AttemptConnection ( Socket attemptSocket, SocketAsyncEventArgs args ) : Exception
attemptSocket Socket
args SocketAsyncEventArgs
return System.Exception
        private static Exception AttemptConnection(Socket attemptSocket, SocketAsyncEventArgs args)
        {
            try
            {
                if (attemptSocket == null)
                {
                    NetEventSource.Fail(null, "attemptSocket is null!");
                }

                if (!attemptSocket.ConnectAsync(args))
                {
                    return new SocketException((int)args.SocketError);
                }
            }
            catch (ObjectDisposedException)
            {
                // This can happen if the user closes the socket, and is equivalent to a call 
                // to CancelConnectAsync
                return new SocketException((int)SocketError.OperationAborted);
            }
            catch (Exception e)
            {
                return e;
            }

            return null;
        }

Same methods

MultipleConnectAsync::AttemptConnection ( ) : Exception