C# Class SharpAdbClient.SocketExtensions

Provides extension methods for the Socket class.
ファイルを表示 Open project: ArduPilot/MissionPlanner

Public Methods

Method Description
ReceiveAsync ( this socket, byte buffer, int offset, int size, SocketFlags socketFlags, CancellationToken cancellationToken ) : Task

Asynchronously receives data from a connected socket.

Cancelling the task will also close the socket.

Method Details

ReceiveAsync() public static method

Asynchronously receives data from a connected socket.
Cancelling the task will also close the socket.
public static ReceiveAsync ( this socket, byte buffer, int offset, int size, SocketFlags socketFlags, CancellationToken cancellationToken ) : Task
socket this /// The socket from which to read data. ///
buffer byte /// An array of type that is the storage location for /// the received data. ///
offset int /// The zero-based position in the parameter at which to /// start storing data. ///
size int /// The number of bytes to receive. ///
socketFlags SocketFlags /// A bitwise combination of the values. ///
cancellationToken System.Threading.CancellationToken /// A which can be used to cancel the asynchronous task. ///
return Task