SslStream.WriteAsync SslStream.WriteAsync SslStream.WriteAsync Method

Definition

Overloads

WriteAsync(ReadOnlyMemory<Byte>, CancellationToken) WriteAsync(ReadOnlyMemory<Byte>, CancellationToken)

Asynchronously writes data to the underlying stream from a read-only byte memory range.

WriteAsync(Byte[], Int32, Int32, CancellationToken) WriteAsync(Byte[], Int32, Int32, CancellationToken) WriteAsync(Byte[], Int32, Int32, CancellationToken)

Asynchronously writes data to the underlying stream from the specified range of a byte array.

WriteAsync(ReadOnlyMemory<Byte>, CancellationToken) WriteAsync(ReadOnlyMemory<Byte>, CancellationToken)

Asynchronously writes data to the underlying stream from a read-only byte memory range.

public override System.Threading.Tasks.ValueTask WriteAsync (ReadOnlyMemory<byte> buffer, System.Threading.CancellationToken cancellationToken = null);
override this.WriteAsync : ReadOnlyMemory<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask

Parameters

buffer
ReadOnlyMemory<Byte>

The data to write to the underlying stream.

cancellationToken
CancellationToken CancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

A task that represents the asynchronous write operation.

Exceptions

The write operation failed.

There is already a write operation in progress.

Remarks

You cannot call this method until you have successfully authenticated.

The SslStream class does not support multiple simultaneous write operations.

WriteAsync(Byte[], Int32, Int32, CancellationToken) WriteAsync(Byte[], Int32, Int32, CancellationToken) WriteAsync(Byte[], Int32, Int32, CancellationToken)

Asynchronously writes data to the underlying stream from the specified range of a byte array.

public:
 override System::Threading::Tasks::Task ^ WriteAsync(cli::array <System::Byte> ^ buffer, int offset, int count, System::Threading::CancellationToken cancellationToken);
public override System.Threading.Tasks.Task WriteAsync (byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken);
override this.WriteAsync : byte[] * int * int * System.Threading.CancellationToken -> System.Threading.Tasks.Task

Parameters

buffer
Byte[]

The data to write to the underlying stream.

offset
Int32 Int32 Int32

The location in buffer from which to start writing data.

count
Int32 Int32 Int32

The number of bytes to write to the underlying stream.

cancellationToken
CancellationToken CancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

A task that represents the asynchronous write operation.

Exceptions

offset is less than 0.

-or-

count is less than 0.

-or-

count is greater than the length of buffer minus offset.

The write operation failed.

There is already a write operation in progress.

Remarks

You cannot call this method until you have successfully authenticated.

The SslStream class does not support multiple simultaneous write operations.

Applies to