System.Net.Security.NegotiateStream.BeginWrite C# (CSharp) Method

BeginWrite() public method

public BeginWrite ( byte buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState ) : IAsyncResult
buffer byte
offset int
count int
asyncCallback AsyncCallback
asyncState object
return IAsyncResult
        public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
        {
#if DEBUG
            using (DebugThreadTracking.SetThreadKind(ThreadKinds.User | ThreadKinds.Async))
            {
#endif
                _negoState.CheckThrow(true);

                if (!_negoState.CanGetSecureStream)
                {
                    return InnerStream.BeginWrite(buffer, offset, count, asyncCallback, asyncState);
                }

                BufferAsyncResult bufferResult = new BufferAsyncResult(this, buffer, offset, count, asyncState, asyncCallback);
                AsyncProtocolRequest asyncRequest = new AsyncProtocolRequest(bufferResult);

                ProcessWrite(buffer, offset, count, asyncRequest);
                return bufferResult;
#if DEBUG
            }
#endif
        }