UDPConnection

Represents a bound and possibly 'connected' UDP socket.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

addMembership
void addMembership(NetworkAddress multiaddr, uint interface_index)

Become a member of an 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.

opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
recv
ubyte[] recv(ubyte[] buf, NetworkAddress* peer_address)
ubyte[] recv(Duration timeout, 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.

fd
int fd [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
localAddress
NetworkAddress localAddress [@property getter]

The local/bind address of the underlying socket.

multicastLoopback
bool multicastLoopback [@property setter]

Set IP multicast loopback mode.

Structs

Context
struct Context
Undocumented in source.

Meta