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

◆ udp_client() [1/6]

xtd::net::sockets::udp_client::udp_client ( )

Initializes a new instance of the xtd::net::sockets::udp_client class.

Exceptions
xtd::net::sockets::socket_exceptionAn error occurred when attempting to access the underlying socket.
Remarks
This constructor creates a new xtd::net::sockets::udp_client and allows the underlying service provider to assign the most appropriate local IPv4 address and port number. If this constructor is used, the xtd::net::sockets::udp_client instance is set with an address family of IPv4 that cannot be changed or overwritten by a connect method call with an IPv6 target.
This constructor is not suitable for joining a multicast group because it does not perform socket binding. Also, it works only with IPv4 address types.
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.