Add listenUDP overload taking a NetworkAddress.

This commit is contained in:
Sönke Ludwig 2017-09-03 11:17:54 +02:00
parent 1ef8d5206f
commit 7e1d6a7323

View file

@ -208,6 +208,11 @@ TCPConnection connectTCP(NetworkAddress addr, NetworkAddress bind_address = anyA
/**
Creates a bound UDP socket suitable for sending and receiving packets.
*/
UDPConnection listenUDP(ref NetworkAddress addr)
{
return UDPConnection(addr);
}
/// ditto
UDPConnection listenUDP(ushort port, string bind_address = "0.0.0.0")
{
auto addr = resolveHost(bind_address, AddressFamily.UNSPEC, false);