System.IO.Pipes.PipeStream.BeginWrite C# (CSharp) Méthode

BeginWrite() public méthode

public BeginWrite ( byte buffer, int offset, int count, AsyncCallback callback, object state ) : IAsyncResult
buffer byte
offset int
count int
callback AsyncCallback
state object
Résultat IAsyncResult
        public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
        {
            if (_isAsync)
                return TaskToApm.Begin(WriteAsync(buffer, offset, count, CancellationToken.None), callback, state);
            else
                return base.BeginWrite(buffer, offset, count, callback, state);
        }

Same methods

PipeStream::BeginWrite ( byte buffer, int offset, int count, System callback, object state ) : System.IAsyncResult

Usage Example

Exemple #1
0
    public void OnAsyncMessage(PipeStream pipe, Byte [] data, Int32 bytes, Object state)
    {
        Console.WriteLine("Message: " + (Int32) state + " bytes: " + bytes);
        data = Encoding.UTF8.GetBytes(Encoding.UTF8.GetString(data, 0, bytes).ToUpper().ToCharArray());

        // Write results
        try {
            pipe.BeginWrite(data, 0, bytes, OnAsyncWriteComplete, pipe);
        }
        catch (Exception) {
            pipe.Close();
        }
    }
All Usage Examples Of System.IO.Pipes.PipeStream::BeginWrite