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

◆ begin_send() [2/3]

xtd::sptr< xtd::iasync_result > xtd::net::sockets::udp_client::begin_send ( const std::vector< xtd::byte > &  dgram,
size_t  bytes,
const xtd::net::ip_end_point end_point,
xtd::async_callback  callback,
const std::any &  state 
)

xtd::net::sockets::udp_client::sends a datagram to a destination asynchronously. The destination is specified by a EndPoint.

Parameters
dgramA byte array that contains the data to be sent.
bytesThe number of bytes to send.
end_pointThe EndPoint that represents the destination for the data.
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 send operation. This object is passed to the callback delegate when the operation is complete.
Returns
An xtd::iasync_result object that references the asynchronous send.
Remarks
The asynchronous xtd::net::sockets::udp_client::begin_send operation must be completed by calling the xtd::net::sockets::udp_client::end_send 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 one of the xtd::net::sockets::udp_client::send method overloads.