BufferedTCPConnection

Constructors

this
this(EventLoop evl, fd_t preInitializedSocket, OnEvent onConnectCb, OnEvent onCloseCb, OnEvent onErrorCb)
this
this(AsyncTCPConnection conn, OnEvent onConnectCb, OnEvent onCloseCb, OnEvent onErrorCb)

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(size_t len, 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, T val)

Changes the default OS configurations for this underlying TCP Socket.

write
void write(R msg, size_t len, OnEvent cb)

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