BufferedTCPConnection

Undocumented in source.

Constructors

this
this(EventLoop evl, fd_t preInitializedSocket, OnEvent onConnectCb, OnEvent onCloseCb, OnEvent onErrorCb)
Undocumented in source.
this
this(AsyncTCPConnection conn, OnEvent onConnectCb, OnEvent onCloseCb, OnEvent onErrorCb)
Undocumented in source.

Members

Aliases

OnEvent
alias OnEvent = void delegate(BufferedTCPConnection!size conn)
Undocumented in source.
OnRead
alias OnRead = void delegate(BufferedTCPConnection!size conn, in ubyte[] msg)
Undocumented in source.

Functions

close
void close()
Undocumented in source. Be warned that the author may not have intended to support it.
handle
void handle(TCPEvent ev)
Undocumented in source. Be warned that the author may not have intended to support it.
host
typeof(this) host(string hostname, size_t port)

(Blocking) Resolves the specified host and resets the peer to this address. Use AsyncDNS for a non-blocking resolver. (only usable before connecting).

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

Sets the peer to the specified IP address and port. (only usable before connecting).

read
void read(size_t len, OnRead onReadCb)
Undocumented in source. Be warned that the author may not have intended to support it.
run
bool run(void delegate(TCPEvent) del)

Starts the connection by registering the associated callback handler in the underlying OS event loop.

setOption
bool setOption(TCPOption op, T val)

Changes the default OS configurations for this underlying TCP Socket.

write
void write(R msg, size_t len, OnEvent cb)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

error
string error [@property getter]
hasError
bool hasError [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
inbound
bool inbound [@property getter]
isConnected
bool isConnected [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
local
NetworkAddress local [@property getter]

Returns the OS-specific structure of the internet address for the local end of the connection.

noDelay
bool noDelay [@property setter]

Disables(true)/enables(false) nagle's algorithm (default:enabled).

peer
NetworkAddress peer [@property getter]

Returns the OS-specific structure of the internet address of the remote network adapter

peer
NetworkAddress peer [@property setter]

Sets the remote address as an OS-specific structure (only usable before connecting).

status
StatusInfo status [@property getter]

The status code is Status.ASYNC if the call is delayed (yield), Status.ABORT if an unrecoverable socket/fd error occurs (throw), or Status.ERROR if an internal error occured (assert).

Meta