System.Net.Sockets.SocketAsyncEventArgs.SetBuffer Method

Sets the data buffer to use with an asynchronous socket method.

Syntax

public void SetBuffer (byte[] buffer, int offset, int count)

Parameters

buffer
The data buffer to use with an asynchronous socket method.
offset
The offset, in bytes, in the data buffer where the operation starts.
count
The maximum amount of data, in bytes, to send or receive in the buffer.

Remarks

The offset and count parameters can't be negative numbers. The combination of the offset and count parameters must be in bounds of the data array in the buffer parameter.

This method sets the SocketAsyncEventArgs.Buffer property to the buffer parameter, the SocketAsyncEventArgs.Count property to the count parameter, and the SocketAsyncEventArgs.Offset property to the offset parameter.

Requirements

Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0