xtd::sptr< xtd::iasync_result > xtd::net::sockets::socket::begin_receive_from | ( | std::vector< xtd::byte > & | buffer, |
size_t | offset, | ||
size_t | size, | ||
xtd::net::sockets::socket_flags | socket_flags, | ||
xtd::net::end_point & | remote_end_point, | ||
xtd::async_callback | callback, | ||
const std::any & | state | ||
) |
Begins to asynchronously receive data from a specified network device.
buffer | An array of type xtd::byte that is the storage location for the received data. |
offset | The zero-based position in the buffer parameter at which to store the data. |
size | The number of bytes to receive. |
socket_flags | A bitwise combination of the xtd::net::sockets::socket_flags values. |
remote_end_point | An xtd::net::end_point that represents the source of the data. |
callback | The xtd::async_callback delegate. |
state | An object that contains state information for this request. |
xtd::argument_out_of_range_exception | size is less than 0 or exceeds the size of the buffer. |
xtd::object_closed_exception | The xtd::net::sockets::socket has been closed. |
xtd::invalid_operation_exception | The accepting socket is not listening for connections. You must call xtd::net::sockets::socket::bind and xtd::net::sockets::socket::listen before calling xtd::net::sockets::socket::accept(). |