SocketAsyncEventArgs.BufferList Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets an array of data buffers to use with an asynchronous socket method.
public:
property System::Collections::Generic::IList<ArraySegment<System::Byte>> ^ BufferList { System::Collections::Generic::IList<ArraySegment<System::Byte>> ^ get(); void set(System::Collections::Generic::IList<ArraySegment<System::Byte>> ^ value); };
public System.Collections.Generic.IList<ArraySegment<byte>> BufferList { get; set; }
public System.Collections.Generic.IList<ArraySegment<byte>>? BufferList { get; set; }
member this.BufferList : System.Collections.Generic.IList<ArraySegment<byte>> with get, set
Public Property BufferList As IList(Of ArraySegment(Of Byte))
Property Value
An IList that represents an array of data buffers to use with an asynchronous socket method.
Exceptions
There are ambiguous buffers specified on a set operation. This exception occurs if the Buffer property has been set to a non-null value and an attempt was made to set the BufferList property to a non-null value.
Remarks
This property is used with the Socket.ReceiveAsync and Socket.SendAsync methods.
This property is used to provide multiple buffers of data to be sent or to provide multiple buffers in which to store received data for an asynchronous socket operation that can send or receive data. Multiple buffers using the BufferList property are supported by the Socket.ReceiveAsync and Socket.SendAsync methods.
If the BufferList property is set to a non-null value, the Buffer property must be null and is ignored by the Socket.ReceiveAsync and Socket.SendAsync methods.
If the Buffer was set to a non-null value and an attempt is made to set the BufferList property to a non-null value, an exception is thrown.
If the BufferList property is set to a non-null value, the Socket.ConnectAsync and Socket.AcceptAsync methods will throw an ArgumentException.
The BufferList parameter is ignored by the Socket.DisconnectAsync and Socket.SendPacketsAsync methods.