System.Net.Sockets.SocketAsyncEventArgs.SetResults C# (CSharp) Method

SetResults() private method

private SetResults ( Exception exception, int bytesTransferred, SocketFlags flags ) : void
exception Exception
bytesTransferred int
flags SocketFlags
return void
        internal void SetResults(Exception exception, int bytesTransferred, SocketFlags flags)
        {
            _connectByNameError = exception;
            _bytesTransferred = bytesTransferred;
            _socketFlags = flags;

            if (exception == null)
            {
                _socketError = SocketError.Success;
            }
            else
            {
                SocketException socketException = exception as SocketException;
                if (socketException != null)
                {
                    _socketError = socketException.SocketErrorCode;
                }
                else
                {
                    _socketError = SocketError.SocketError;
                }
            }
        }

Same methods

SocketAsyncEventArgs::SetResults ( SocketError socketError, int bytesTransferred, SocketFlags flags ) : void
SocketAsyncEventArgs