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

◆ begin_receive()

xtd::sptr< xtd::iasync_result > xtd::net::sockets::udp_client::begin_receive ( xtd::async_callback  callback,
const std::any &  state 
)

xtd::net::sockets::udp_client::receives a datagram from a remote host asynchronously.

Parameters
callbackAn xtd::async_callback delegate that references the method to invoke when the operation is complete.
stateA user-defined object that contains information about the receive operation. This object is passed to the callback delegate when the operation is complete.
Returns
An xtd::iasync_result object that references the asynchronous receive.
Remarks
The asynchronous xtd::net::sockets::udp_client::begin_receive operation must be completed by calling the xtd::net::sockets::udp_client::end_receive method. Typically, the method is invoked by the callback delegate.
This method does not block until the operation is complete. To block until the operation is complete, use the xtd::net::sockets::udp_client::receive method.