Modifier and Type | Method and Description |
---|---|
int |
actualPort()
The actual port the server is listening on.
|
Future<Void> |
close()
Close the server.
|
void |
close(Handler<AsyncResult<Void>> completionHandler)
Like
close() but supplying a handler that will be notified when close is complete. |
Handler<NetSocket> |
connectHandler() |
NetServer |
connectHandler(Handler<NetSocket> handler)
Supply a connect handler for this server.
|
ReadStream<NetSocket> |
connectStream()
Deprecated.
instead use
connectHandler(Handler) |
NetServer |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler called for socket errors happening before the connection
is passed to the
connectHandler(io.vertx.core.Handler<io.vertx.core.net.NetSocket>) , e.g during the TLS handshake. |
Future<NetServer> |
listen()
Start listening on the port and host as configured in the
NetServerOptions used when
creating the server. |
default NetServer |
listen(Handler<AsyncResult<NetServer>> listenHandler)
Like
listen() but providing a handler that will be notified when the server is listening, or fails. |
default Future<NetServer> |
listen(int port)
Start listening on the specified port and host "0.0.0.0", ignoring port and host configured in the
NetServerOptions used when creating the server. |
default NetServer |
listen(int port,
Handler<AsyncResult<NetServer>> listenHandler)
Like
listen(int) but providing a handler that will be notified when the server is listening, or fails. |
default Future<NetServer> |
listen(int port,
String host)
Start listening on the specified port and host, ignoring port and host configured in the
NetServerOptions used when
creating the server. |
default NetServer |
listen(int port,
String host,
Handler<AsyncResult<NetServer>> listenHandler)
Like
listen(int, String) but providing a handler that will be notified when the server is listening, or fails. |
Future<NetServer> |
listen(SocketAddress localAddress)
Start listening on the specified local address, ignoring port and host configured in the
NetServerOptions used when
creating the server. |
default NetServer |
listen(SocketAddress localAddress,
Handler<AsyncResult<NetServer>> listenHandler)
Like
listen(SocketAddress) but providing a handler that will be notified when the server is listening, or fails. |
Future<Void> |
updateSSLOptions(SSLOptions options)
Update the server SSL options.
|
default void |
updateSSLOptions(SSLOptions options,
Handler<AsyncResult<Void>> handler)
Like
updateSSLOptions(SSLOptions) but supplying a handler that will be called when the update
happened (or has failed). |
isMetricsEnabled
@Deprecated ReadStream<NetSocket> connectStream()
connectHandler(Handler)
NetSocket
and passes it to the
connect stream ReadStream.handler(io.vertx.core.Handler)
.NetServer connectHandler(Handler<NetSocket> handler)
NetSocket
and passes it to the
connect handler.Future<NetServer> listen()
NetServerOptions
used when
creating the server.
The server may not be listening until some time after the call to listen has returned.
default NetServer listen(Handler<AsyncResult<NetServer>> listenHandler)
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 faileddefault Future<NetServer> listen(int port, String host)
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.
default NetServer listen(int port, String host, Handler<AsyncResult<NetServer>> listenHandler)
listen(int, String)
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 faileddefault Future<NetServer> listen(int port)
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.
default NetServer listen(int port, Handler<AsyncResult<NetServer>> listenHandler)
listen(int)
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 failedFuture<NetServer> listen(SocketAddress localAddress)
NetServerOptions
used when
creating the server.
The server may not be listening until some time after the call to listen has returned.
localAddress
- the local address to listen ondefault NetServer listen(SocketAddress localAddress, Handler<AsyncResult<NetServer>> listenHandler)
listen(SocketAddress)
but providing a handler that will be notified when the server is listening, or fails.localAddress
- the local address to listen onlistenHandler
- handler that will be notified when listening or failedNetServer exceptionHandler(Handler<Throwable> handler)
connectHandler(io.vertx.core.Handler<io.vertx.core.net.NetSocket>)
, e.g during the TLS handshake.handler
- the handler to setFuture<Void> close()
void close(Handler<AsyncResult<Void>> completionHandler)
close()
but supplying a handler that will be notified when close is complete.completionHandler
- the handlerint actualPort()
Future<Void> updateSSLOptions(SSLOptions options)
options
- the new SSL optionsdefault void updateSSLOptions(SSLOptions options, Handler<AsyncResult<Void>> handler)
updateSSLOptions(SSLOptions)
but supplying a handler that will be called when the update
happened (or has failed).options
- the new SSL optionshandler
- the update handlerCopyright © 2024 Eclipse. All rights reserved.