SocketTaskExtensions.SendToAsync Method
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.
Sends data asynchronously to a specific remote host.
public:
[System::Runtime::CompilerServices::Extension]
static System::Threading::Tasks::Task<int> ^ SendToAsync(System::Net::Sockets::Socket ^ socket, ArraySegment<System::Byte> buffer, System::Net::Sockets::SocketFlags socketFlags, System::Net::EndPoint ^ remoteEP);
public static System.Threading.Tasks.Task<int> SendToAsync (this System.Net.Sockets.Socket socket, ArraySegment<byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP);
static member SendToAsync : System.Net.Sockets.Socket * ArraySegment<byte> * System.Net.Sockets.SocketFlags * System.Net.EndPoint -> System.Threading.Tasks.Task<int>
<Extension()>
Public Function SendToAsync (socket As Socket, buffer As ArraySegment(Of Byte), socketFlags As SocketFlags, remoteEP As EndPoint) As Task(Of Integer)
Parameters
- socket
- Socket
The socket to perform the operation on.
- buffer
- ArraySegment<Byte>
An array that contains the data to send.
- socketFlags
- SocketFlags
A bitwise combination of the SocketFlags values.
Returns
An asynchronous task that completes with number of bytes sent if the operation was successful. Otherwise, the task will complete with an invalid socket error.
Exceptions
remoteEP
is null
.
An error occurred when attempting to access the socket.
The Socket has been closed.
Applies to
Pripomienky
https://aka.ms/ContentUserFeedback.
Pripravujeme: V priebehu roka 2024 postupne zrušíme službu Problémy v službe GitHub ako mechanizmus pripomienok týkajúcich sa obsahu a nahradíme ju novým systémom pripomienok. Ďalšie informácie nájdete na stránke:Odoslať a zobraziť pripomienky pre