/// A wrapper class for the user datagram protocol socket.
classUDP:publicBaseUDP
{
private:
Sockethdl;
public:
/// Frees any native handles.
~UDP()override;
UDP();
/// Default members initialization.
UDP(AddrTypetype);
UDP(UDP&&udp)noexcept;
/// Copies some members from the given UDP object.
/// @param [in] udp The UDP object to copy from.
UDP(constUDP&udp);
UDP&operator=(UDP&&udp)noexcept;
/// Copies some members from the given UDP object.
/// @param [in] udp The UDP object to copy from.
/// @returns The UDP object that has been assigned to.
UDP&operator=(constUDP&udp);
/// Frees native handles and uninitializes them.
voidRelease()override;
/// Binds the UDP socket to a local address and port.
/// @param [in] address The local IPv4 or IPv6 address to bind to. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device.
/// @param [in] port The port to bind to.
/// @note Requires the port given to be forwarded if this is called.
/// @param [in] addr The remote Ipv4 or Ipv6 address to send to. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device.
/// @param [in] port The remote port to send to.
/// @param [in] data The C-style byte array to send.
/// @param [in] size The size of the C-style byte array.
/// @note The size of data to be sent cannot exceed "UDP::maxPayloadIpv4" or "UDP::maxPayloadIpv6".