BufferedTCPConnection

Constructors

this
this(EventLoop evl, fd_t preInitializedSocket = fd_t.init, in OnEvent onConnectCb = null, in OnEvent onCloseCb = null, in OnEvent onErrorCb = null)
this
this(AsyncTCPConnection conn, in OnEvent onConnectCb = null, in OnEvent onCloseCb = null, in OnEvent onErrorCb = null)

Members

Aliases

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

Functions

close
void close()
handle
void handle(TCPEvent ev)
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(in size_t len, in OnRead onReadCb)
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, in T val)

Changes the default OS configurations for this underlying TCP Socket.

write
void write(in R msg, in size_t len, in OnEvent cb = null)

Properties

error
string error [@property getter]
hasError
bool hasError [@property getter]
inbound
bool inbound [@property getter]
isConnected
bool isConnected [@property getter]
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