System.Net.Sockets.SocketAsyncEventArgs.FinishOperationAsyncFailure C# (CSharp) Метод

FinishOperationAsyncFailure() приватный Метод

private FinishOperationAsyncFailure ( SocketError socketError, int bytesTransferred, SocketFlags flags ) : void
socketError SocketError
bytesTransferred int
flags SocketFlags
Результат void
        internal void FinishOperationAsyncFailure(SocketError socketError, int bytesTransferred, SocketFlags flags)
        {
            SetResults(socketError, bytesTransferred, flags);

            // This will be null if we're doing a static ConnectAsync to a DnsEndPoint with AddressFamily.Unspecified;
            // the attempt socket will be closed anyways, so not updating the state is OK.
            if (_currentSocket != null)
            {
                _currentSocket.UpdateStatusAfterSocketError(socketError);
            }

            Complete();
            if (_context == null)
            {
                OnCompleted(this);
            }
            else
            {
                ExecutionContext.Run(_context, s_executionCallback, this);
            }
        }

Same methods

SocketAsyncEventArgs::FinishOperationAsyncFailure ( Exception exception, int bytesTransferred, SocketFlags flags ) : void

Usage Example

Пример #1
0
        private void AsyncFail(Exception e)
        {
            OnFail(false);
            if (internalArgs != null)
            {
                internalArgs.Dispose();
            }

            userArgs.FinishOperationAsyncFailure(e, 0, SocketFlags.None);
        }
SocketAsyncEventArgs