Renci.SshNet.Abstractions.SocketAbstraction.ContinuousReceiveToken.Process C# (CSharp) Method

Process() public method

public Process ( SocketAsyncEventArgs args ) : void
args System.Net.Sockets.SocketAsyncEventArgs
return void
            public void Process(SocketAsyncEventArgs args)
            {
                if (args.SocketError == SocketError.Success)
                {
                    if (args.BytesTransferred == 0)
                    {
                        // remote socket was closed
                        _completionWaitHandle.Set();
                        return;
                    }

                    _processReceivedBytesAction(args.Buffer, args.Offset, args.BytesTransferred);
                    ResumeOperation(args);
                    return;
                }

                if (IsErrorResumable(args.SocketError))
                {
                    ThreadAbstraction.Sleep(30);
                    ResumeOperation(args);
                    return;
                }

                if (args.SocketError != SocketError.OperationAborted)
                {
                    Exception = new SocketException((int) args.SocketError);
                }

                // we're dealing with a (fatal) error
                _completionWaitHandle.Set();
            }
SocketAbstraction.ContinuousReceiveToken