NetServer

Represents a TCP server

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

Members

Functions

actualPort
int actualPort()

The actual port the server is listening on. This is useful if you bound the server specifying 0 as port number signifying an ephemeral port

close
void close()

Close the server. This will close any currently open connections. The close may not complete until after this method has returned.

eventLoopGroup
EventLoopGroup eventLoopGroup()
Undocumented in source.
getCodec
Codec getCodec()
Undocumented in source.
getHandler
NetConnectionHandler getHandler()

@return the handler which will handle all connections managed by this server.

getOptions
NetServerOptions getOptions()
Undocumented in source.
isOpen
bool isOpen()
Undocumented in source.
listen
void listen()

Start listening on the port and host as configured in the {@link hunt.net.NetServerOptions} used when creating the server. <p> The server may not be listening until some time after the call to listen has returned.

listen
void listen(string host, int port)

Start listening on the specified port and host, ignoring port and host configured in the {@link hunt.net.NetServerOptions} used when creating the server. <p> Port {@code 0} can be specified meaning "choose an random port". <p> Host {@code 0.0.0.0} can be specified meaning "listen on all available interfaces". <p> The server may not be listening until some time after the call to listen has returned.

listen
void listen(int port)

Start listening on the specified port and host "0.0.0.0", ignoring port and host configured in the {@link hunt.net.NetServerOptions} used when creating the server. <p> Port {@code 0} can be specified meaning "choose an random port". <p> The server may not be listening until some time after the call to listen has returned.

setCodec
NetServer setCodec(Codec codec)
Undocumented in source.
setHandler
NetServer setHandler(NetConnectionHandler handler)

Sets the handler which will handle all connections managed by this server.

Meta