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

◆ end_receive_message_from()

size_t xtd::net::sockets::socket::end_receive_message_from ( xtd::sptr< xtd::iasync_result async_result,
xtd::net::sockets::socket_flags socket_flags,
xtd::sptr< xtd::net::end_point > &  end_point,
xtd::net::sockets::ip_packet_information ip_packet_information 
)

Ends a pending asynchronous read from a specific endpoint. This method also reveals more information about the packet than xtd::net::sockets::socket::end_receive_from(xtd::iasync_result, xtd::net::end_point).

Parameters
async_resultAn xtd::iasync_result that stores state information for this asynchronous operation as well as any user defined data.
socket_flagsA bitwise combination of the xtd::net::sockets::socket_flags values for the received packet.
end_pointThe source xtd::net::end_point.
ip_packet_informationThe xtd::net::ip_address and interface of the received packet.
Returns
If successful, the number of bytes received. If unsuccessful, returns 0.
Exceptions
argument_exceptionasyncResult was not returned by a call to the xtd::net::sockets::socket::begin_receive_message_from method.
xtd::net::sockets::socket_exceptionAn error occurred when attempting to access the socket.
xtd::object_closed_exceptionThe xtd::net::sockets::socket has been closed.
Remarks
If the operation has not completed, this method blocks until it does.
To perform this operation synchronously, use the xtd::net::sockets::socket::receive_message_from method.
Examine ipPacketInformation if you need to know if the datagram was sent using a unicast, multicast, or broadcast address.
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.