SslStream.BeginWrite Method (Byte[], Int32, Int32, AsyncCallback, Object)

 

Begins an asynchronous write operation that writes Bytes from the specified buffer to the stream.

Namespace:   System.Net.Security
Assembly:  System (in System.dll)

[<HostProtectionAttribute(SecurityAction.LinkDemand, ExternalThreading = true)>]
override BeginWrite : 
        buffer:byte[] *
        offset:int *
        count:int *
        asyncCallback:AsyncCallback *
        asyncState:Object -> IAsyncResult

Parameters

buffer
Type: System.Byte[]

A Byte array that supplies the bytes to be written to the stream.

offset
Type: System.Int32

The zero-based location in buffer at which to begin reading bytes to be written to the stream.

count
Type: System.Int32

An Int32 value that specifies the number of bytes to read from buffer.

asyncCallback
Type: System.AsyncCallback

An AsyncCallback delegate that references the method to invoke when the write operation is complete.

asyncState
Type: System.Object

A user-defined object that contains information about the write operation. This object is passed to the asyncCallback delegate when the operation completes.

Return Value

Type: System.IAsyncResult

An IAsyncResult object indicating the status of the asynchronous operation.

Exception Condition
ArgumentNullException

buffer is null.

ArgumentException

offset<0.

-or-

offset > the length of buffer.

-or-

offset + count > the length of buffer.

IOException

The write operation failed.

NotSupportedException

There is already a write operation in progress.

ObjectDisposedException

This object has been closed.

InvalidOperationException

Authentication has not occurred.

The following code example demonstrates calling this method.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: