@groovy.transform.CompileStatic class NetServer extends java.lang.Object
Represents a TCP server
Constructor and description |
---|
NetServer
(java.lang.Object delegate) |
Type | Name and description | ||
---|---|---|---|
int |
actualPort() The actual port the server is listening on. |
||
void |
close() Close the server. |
||
void |
close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> completionHandler) Like NetServer.close but supplying a handler that will be notified when close is complete. |
||
NetServer |
connectHandler(io.vertx.core.Handler<NetSocket> handler) Supply a connect handler for this server. |
||
NetSocketStream |
connectStream() Return the connect stream for this server. |
||
java.lang.Object |
getDelegate() |
||
boolean |
isMetricsEnabled() Whether the metrics are enabled for this measured object |
||
NetServer |
listen() Start listening on the port and host as configured in the | NetServer |
listen(io.vertx.core.Handler<io.vertx.core.AsyncResult<NetServer>> listenHandler) Like NetServer.listen but providing a handler that will be notified when the server is listening, or fails. |
NetServer |
listen(int port, java.lang.String host) Start listening on the specified port and host, ignoring post and host configured in the | NetServer |
listen(int port, java.lang.String host, io.vertx.core.Handler<io.vertx.core.AsyncResult<NetServer>> listenHandler) Like NetServer.listen but providing a handler that will be notified when the server is listening, or fails. |
NetServer |
listen(int port) Start listening on the specified port and host "0.0.0.0", ignoring post and host configured in the | NetServer |
listen(int port, io.vertx.core.Handler<io.vertx.core.AsyncResult<NetServer>> listenHandler) Like NetServer.listen but providing a handler that will be notified when the server is listening, or fails. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
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 the server. This will close any currently open connections. The close may not complete until after this method has returned.
Like NetServer.close but supplying a handler that will be notified when close is complete.
completionHandler
- the handlerSupply 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.
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 .
Whether the metrics are enabled for this measured object
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.
Like NetServer.listen but providing a handler that will be notified when the server is listening, or fails.
listenHandler
- handler that will be notified when listening or failedStart listening on the specified port and host, ignoring post and host configured in the NetServerOptions used when creating the server.
Port 0
can be specified meaning "choose an random port".
Host 0.0.0.0
can be specified meaning "listen on all available interfaces".
The server may not be listening until some time after the call to listen has returned.
Like NetServer.listen but providing a handler that will be notified when the server is listening, or fails.
port
- the port to listen onhost
- the host to listen onlistenHandler
- handler that will be notified when listening or failedStart 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 0
can be specified meaning "choose an random port".
The server may not be listening until some time after the call to listen has returned.
Like NetServer.listen but providing a handler that will be notified when the server is listening, or fails.
port
- the port to listen onlistenHandler
- handler that will be notified when listening or failed