SocketTaskExtensions.ReceiveMessageFromAsync Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Riceve il numero specificato di byte di dati nella posizione specificata del buffer di dati, utilizzando l'oggetto specificato SocketFlagse archivia l'endpoint e le informazioni sui pacchetti.
public:
[System::Runtime::CompilerServices::Extension]
static System::Threading::Tasks::Task<System::Net::Sockets::SocketReceiveMessageFromResult> ^ ReceiveMessageFromAsync(System::Net::Sockets::Socket ^ socket, ArraySegment<System::Byte> buffer, System::Net::Sockets::SocketFlags socketFlags, System::Net::EndPoint ^ remoteEndPoint);
public static System.Threading.Tasks.Task<System.Net.Sockets.SocketReceiveMessageFromResult> ReceiveMessageFromAsync(this System.Net.Sockets.Socket socket, ArraySegment<byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEndPoint);
static member ReceiveMessageFromAsync : System.Net.Sockets.Socket * ArraySegment<byte> * System.Net.Sockets.SocketFlags * System.Net.EndPoint -> System.Threading.Tasks.Task<System.Net.Sockets.SocketReceiveMessageFromResult>
<Extension()>
Public Function ReceiveMessageFromAsync (socket As Socket, buffer As ArraySegment(Of Byte), socketFlags As SocketFlags, remoteEndPoint As EndPoint) As Task(Of SocketReceiveMessageFromResult)
Parametri
- socket
- Socket
Socket su cui eseguire l'operazione.
- buffer
- ArraySegment<Byte>
Matrice che rappresenta il percorso di archiviazione per i dati ricevuti.
- socketFlags
- SocketFlags
Combinazione bit per bit dei SocketFlags valori.
Valori restituiti
Attività asincrona che viene completata con uno SocketReceiveMessageFromResult struct.
Eccezioni
L'oggetto Socket è stato chiuso.
Il remoteEndPoint è null.
È necessario chiamare il metodo Bind prima di eseguire questa operazione.