AsyncUDPSocket

Wrapper for a UDP Stream which must be bound to a socket.

Constructors

this
this(EventLoop evl, fd_t preInitializedSocket)

Members

Functions

broadcast
bool broadcast(bool b)

Grants broadcast permissions to the socket (must be set before run).

host
typeof(this) host(string hostname, size_t port)

Sets the hostname and port to which the UDP socket must be bound locally.

ip
typeof(this) ip(string ip, size_t port)

Sets the IP and port to which the UDP socket will be bound locally.

kill
bool kill()

Cleans up the resources associated with this object in the underlying OS.

recvFrom
uint recvFrom(ubyte[] data, NetworkAddress addr)

Receives data from one peer and copies its address to the associated OS-specific address structure.

run
bool run(void delegate(UDPEvent) del)

Registers the UDP socket in the underlying OS event loop, forwards all related events to the specified delegate.

sendTo
uint sendTo(ubyte[] data, NetworkAddress addr)

Sends data to the internet address specified by the associated OS-specific structure.

Mixins

__anonymous
mixin DefStatus
Undocumented in source.
__anonymous
mixin EvInfoMixins
Undocumented in source.

Properties

local
NetworkAddress local [@property getter]

Returns the locally bound address as an OS-specific structure.

local
NetworkAddress local [@property setter]

Sets the local network address to which this UDP Socket will be bound.

preInitializedSocket
fd_t preInitializedSocket [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
socket
fd_t socket [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
socket
fd_t socket [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.

Mixed In Members

From mixin DefStatus

hasError
bool hasError [@property getter]

Check this property to make sure the event loop hasn't failed

status
StatusInfo status [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
error
string error [@property getter]

Returns a human-readable error message from the underlying operating system.

From mixin EvInfoMixins

CleanupData
struct CleanupData
Undocumented in source.
evInfo
EventInfo* evInfo [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
evInfo
EventInfo* evInfo [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.

Meta