xtd 0.2.0
Loading...
Searching...
No Matches

◆ end_receive()

std::vector< xtd::byte > xtd::net::sockets::udp_client::end_receive ( xtd::sptr< xtd::iasync_result async_result,
xtd::net::ip_end_point remote_end_point 
)

Ends a pending asynchronous receive.

Parameters
async_resultAn xtd::iasync_result object returned by a call to xtd::net::sockets::udp_client::begin_receive(xtd::async_callback, Object).
remote_end_pointThe specified remote endpoint.
Returns
If successful, an array of bytes that contains datagram data.
Exceptions
argument_exceptionasyncResult was not returned by a call to the xtd::net::sockets::udp_client::begin_receive method.
xtd::net::sockets::socket_exceptionAn error occurred when attempting to access the underlying socket.
xtd::object_closed_exceptionThe underlying xtd::net::sockets::socket has been closed.
Remarks
This method blocks until the operation is complete.
To perform this operation synchronously, use the xtd::net::sockets::udp_client::receive method.
Note
If you receive a xtd::net::sockets::socket_exception, use the xtd::net::sockets::socket_exception::error_code property to obtain the specific error code. After you have obtained this code, refer to the Windows Sockets version 2 API error code documentation in the MSDN library for a detailed description of the error.