NetClient

A TCP client. <p> Multiple connections to different servers can be made using the same instance. <p> This client supports a configurable number of connection attempts and a configurable delay between attempts.

@author <a href="http://tfox.org">Tim Fox</a>

Members

Aliases

onClosed
alias onClosed = setOnClosed
Undocumented in source.

Functions

close
void close()

Close the client. <p> Any sockets which have not been closed manually will be closed here. The close is asynchronous and may not complete until some time after the method has returned.

connect
void connect(string host, int port)

Open a connection to a server at the specific {@code port} and {@code host}. <p> {@code host} can be a valid host name or IP address. The connect is done asynchronously and on success, a {@link Connection} instance is supplied via the {@code connectHandler} instance

connect
void connect(string host, int port, string serverName)

Open a connection to a server at the specific {@code port} and {@code host}. <p> {@code host} can be a valid host name or IP address. The connect is done asynchronously and on success, a {@link Connection} instance is supplied via the {@code connectHandler} instance

getCodec
Codec getCodec()
Undocumented in source.
getHandler
NetConnectionHandler getHandler()
Undocumented in source.
getHost
string getHost()
Undocumented in source.
getId
int getId()
Undocumented in source.
getOptions
NetClientOptions getOptions()
Undocumented in source.
getPort
int getPort()
Undocumented in source.
isConnected
bool isConnected()
Undocumented in source.
setCodec
NetClient setCodec(Codec codec)
Undocumented in source.
setHandler
NetClient setHandler(NetConnectionHandler handler)
Undocumented in source.
setOnClosed
void setOnClosed(void delegate() handler)
Undocumented in source.
setOptions
NetClient setOptions(NetClientOptions options)
Undocumented in source.

Meta