SocketTaskExtensions.ReceiveAsync SocketTaskExtensions.ReceiveAsync SocketTaskExtensions.ReceiveAsync Method

定義

オーバーロード

ReceiveAsync(Socket, ArraySegment<Byte>, SocketFlags) ReceiveAsync(Socket, ArraySegment<Byte>, SocketFlags) ReceiveAsync(Socket, ArraySegment<Byte>, SocketFlags)

接続されたソケットからデータを受信します。Receives data from a connected socket.

ReceiveAsync(Socket, IList<ArraySegment<Byte>>, SocketFlags) ReceiveAsync(Socket, IList<ArraySegment<Byte>>, SocketFlags) ReceiveAsync(Socket, IList<ArraySegment<Byte>>, SocketFlags)

接続されたソケットからデータを受信します。Receives data from a connected socket.

ReceiveAsync(Socket, Memory<Byte>, SocketFlags, CancellationToken) ReceiveAsync(Socket, Memory<Byte>, SocketFlags, CancellationToken)

ReceiveAsync(Socket, ArraySegment<Byte>, SocketFlags) ReceiveAsync(Socket, ArraySegment<Byte>, SocketFlags) ReceiveAsync(Socket, ArraySegment<Byte>, SocketFlags)

接続されたソケットからデータを受信します。Receives data from a connected socket.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<int> ^ ReceiveAsync(System::Net::Sockets::Socket ^ socket, ArraySegment<System::Byte> buffer, System::Net::Sockets::SocketFlags socketFlags);
public static System.Threading.Tasks.Task<int> ReceiveAsync (this System.Net.Sockets.Socket socket, ArraySegment<byte> buffer, System.Net.Sockets.SocketFlags socketFlags);
static member ReceiveAsync : System.Net.Sockets.Socket * ArraySegment<byte> * System.Net.Sockets.SocketFlags -> System.Threading.Tasks.Task<int>

パラメーター

socket
Socket Socket Socket

受信操作を実行するソケット。The socket to perform the receive operation on.

buffer
ArraySegment<Byte>

受信したデータの格納場所である配列。An array that is the storage location for the received data.

socketFlags
SocketFlags SocketFlags SocketFlags

SocketFlags 値のビットごとの組み合わせ。A bitwise combination of the SocketFlags values.

戻り値

非同期の受信操作を表すタスク。A task that represents the asynchronous receive operation. TResult パラメーターの値には、受信バイト数が含まれます。The value of the TResult parameter contains the number of bytes received.

ReceiveAsync(Socket, IList<ArraySegment<Byte>>, SocketFlags) ReceiveAsync(Socket, IList<ArraySegment<Byte>>, SocketFlags) ReceiveAsync(Socket, IList<ArraySegment<Byte>>, SocketFlags)

接続されたソケットからデータを受信します。Receives data from a connected socket.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<int> ^ ReceiveAsync(System::Net::Sockets::Socket ^ socket, System::Collections::Generic::IList<ArraySegment<System::Byte>> ^ buffers, System::Net::Sockets::SocketFlags socketFlags);
public static System.Threading.Tasks.Task<int> ReceiveAsync (this System.Net.Sockets.Socket socket, System.Collections.Generic.IList<ArraySegment<byte>> buffers, System.Net.Sockets.SocketFlags socketFlags);
static member ReceiveAsync : System.Net.Sockets.Socket * System.Collections.Generic.IList<ArraySegment<byte>> * System.Net.Sockets.SocketFlags -> System.Threading.Tasks.Task<int>

パラメーター

socket
Socket Socket Socket

受信操作を実行するソケット。The socket to perform the receive operation on.

buffers
IList<ArraySegment<Byte>>

受信したデータの格納場所である配列。An array that is the storage location for the received data.

socketFlags
SocketFlags SocketFlags SocketFlags

SocketFlags 値のビットごとの組み合わせ。A bitwise combination of the SocketFlags values.

戻り値

非同期の受信操作を表すタスク。A task that represents the asynchronous receive operation. TResult パラメーターの値には、受信バイト数が含まれます。The value of the TResult parameter contains the number of bytes received.

ReceiveAsync(Socket, Memory<Byte>, SocketFlags, CancellationToken) ReceiveAsync(Socket, Memory<Byte>, SocketFlags, CancellationToken)

public static System.Threading.Tasks.ValueTask<int> ReceiveAsync (this System.Net.Sockets.Socket socket, Memory<byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Threading.CancellationToken cancellationToken = null);
static member ReceiveAsync : System.Net.Sockets.Socket * Memory<byte> * System.Net.Sockets.SocketFlags * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<int>

パラメーター

buffer
Memory<Byte>

戻り値

適用対象