UDPConnection

Represents a bound and possibly 'connected' UDP socket.

Members

Functions

addMembership
void addMembership(NetworkAddress multiaddr)

Become member of IP multicast group

close
void close()

Stops listening for datagrams and frees all resources.

connect
void connect(string host, ushort port)
void connect(NetworkAddress address)

Locks the UDP connection to a certain peer.

recv
ubyte[] recv(Duration timeout, ubyte[] buf, NetworkAddress* peer_address)

Receives a single packet.

recv
ubyte[] recv(ubyte[] buf, NetworkAddress* peer_address)

Receives a single packet.

send
void send(ubyte[] data, NetworkAddress* peer_address)

Sends a single packet.

Properties

bindAddress
string bindAddress [@property getter]

Returns the address to which the UDP socket is bound.

canBroadcast
bool canBroadcast [@property getter]
bool canBroadcast [@property setter]

Determines if the socket is allowed to send to broadcast addresses.

localAddress
NetworkAddress localAddress [@property getter]

The local/bind address of the underlying socket.

multicastLoopback
bool multicastLoopback [@property setter]

Set IP multicast loopback

Meta