AsyncSocket

Undocumented in source.

Constructors

this
this(SocketAddress address, int type, int protocol)

Creates a socket compatible with the given address. It does not actually connect or bind, nor store the address. You will want to pass it again to those functions:

Members

Functions

accept
AsyncAcceptRequest accept()

You can also construct your own request externally to control the memory more.

bind
void bind(SocketAddress address, bool allowQuickRestart)

allowQuickRestart will set the SO_REUSEADDR on unix and SO_DONTLINGER on Windows, allowing the application to be quickly restarted despite there still potentially being pending data in the tcp stack.

close
void close()
connect
AsyncConnectRequest connect(SocketAddress address, ubyte[] bufferToSend)

You can also construct your own request externally to control the memory more.

handle
NativeSocketHandle handle()
listen
void listen(int backlog)

You must call bind before this.

localAddress
SocketAddress localAddress()
peerAddress
SocketAddress peerAddress()
receive
AsyncReceiveRequest receive(ubyte[] buffer, int flags)

You can also construct your own request externally to control the memory more.

receiveFrom
AsyncReceiveRequest receiveFrom(ubyte[] buffer, SocketAddress* address, int flags)

You can also construct your own request externally to control the memory more.

send
AsyncSendRequest send(const(ubyte)[] buffer, int flags)

You can also construct your own request externally to control the memory more.

sendTo
AsyncSendRequest sendTo(const(ubyte)[] buffer, SocketAddress* address, int flags)

You can also construct your own request externally to control the memory more.

setNoDelay
void setNoDelay(bool enabled)

Enabling NODELAY can give latency improvements if you are managing buffers on your end

shutdown
void shutdown(int how)

Meta