Represents a TCP server
Anything
no subtypes hierarchy
Initializer |
NetServer(NetServer unknown) |
Inherited Attributes |
Attributes inherited from: Object hash , string |
Methods | |
actualPort | shared default Integer 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 | shared default void close() Close the server. This will close any currently open connections. The close may not complete until after this method has returned. |
close | shared default void close(Anything(Throwable?) completionHandler) Like close but supplying a handler that will be notified when close is complete. Parameters:
|
connectHandler | shared default NetServer connectHandler(Anything(NetSocket)? handler) Supply a connect handler for this server. The server can only have at most one connect handler at any one time. As the server accepts TCP or SSL connections it creates an instance of NetSocket and passes it to the connect handler. |
connectStream | shared default NetSocketStream connectStream() Return the connect stream for this server. The server can only have at most one handler at any one time. As the server accepts TCP or SSL connections it creates an instance of NetSocket and passes it to the connect stream . |
isMetricsEnabled | shared actual default Boolean isMetricsEnabled() Whether the metrics are enabled for this measured object Refines Measured.isMetricsEnabled |
listen | shared default NetServer listen() Start listening on the port and host as configured in the NetServerOptions used when creating the server. The server may not be listening until some time after the call to listen has returned. |
listen | shared default NetServer listen(Anything(Throwable|NetServer) listenHandler) Like listen but providing a handler that will be notified when the server is listening, or fails. Parameters:
|
listen | shared default NetServer listen(Integer port) Start listening on the specified port and host “0.0.0.0”, ignoring post and host configured in the NetServerOptions used when creating the server.
Port The server may not be listening until some time after the call to listen has returned. |
listen | shared default NetServer listen(Integer port, Anything(Throwable|NetServer) listenHandler) Like listen but providing a handler that will be notified when the server is listening, or fails. Parameters:
|
listen | shared default NetServer listen(Integer port, String host) Start listening on the specified port and host, ignoring post and host configured in the NetServerOptions used when creating the server.
Port
Host The server may not be listening until some time after the call to listen has returned. |
listen | shared default NetServer listen(Integer port, String host, Anything(Throwable|NetServer) listenHandler) Like listen but providing a handler that will be notified when the server is listening, or fails. Parameters:
|
Inherited Methods |
Methods inherited from: Object equals |
Methods inherited from: Measured |