public class NetServerImpl extends Object implements NetServer, Closeable, MetricsProvider
| Constructor and Description |
|---|
NetServerImpl(VertxInternal vertx,
NetServerOptions options) |
| Modifier and Type | Method and Description |
|---|---|
int |
actualPort()
The actual port the server is listening on.
|
void |
close()
Close the server.
|
void |
close(Handler<AsyncResult<Void>> done)
Like
NetServer.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.
|
NetSocketStream |
connectStream()
Return the connect stream for this server.
|
protected void |
finalize() |
Metrics |
getMetrics()
Returns the metrics implementation.
|
boolean |
isMetricsEnabled()
Whether the metrics are enabled for this measured object
|
NetServer |
listen()
Start listening on the port and host as configured in the
NetServerOptions used when
creating the server. |
NetServer |
listen(Handler<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
NetServerOptions used when creating the server. |
NetServer |
listen(int port,
Handler<AsyncResult<NetServer>> listenHandler)
Like
NetServer.listen(int) but providing a handler that will be notified when the server is listening, or fails. |
NetServer |
listen(int port,
String host)
Start listening on the specified port and host, ignoring post and host configured in the
NetServerOptions used when
creating the server. |
NetServer |
listen(int port,
String host,
Handler<AsyncResult<NetServer>> listenHandler)
Like
NetServer.listen(int, String) but providing a handler that will be notified when the server is listening, or fails. |
public NetServerImpl(VertxInternal vertx, NetServerOptions options)
public NetServer connectHandler(Handler<NetSocket> handler)
NetServerNetSocket and passes it to the
connect handler.connectHandler in interface NetServerpublic Handler<NetSocket> connectHandler()
connectHandler in interface NetServerpublic NetSocketStream connectStream()
NetServerNetSocket and passes it to the
connect stream ReadStream.handler(io.vertx.core.Handler).connectStream in interface NetServerpublic NetServer listen(int port, String host)
NetServerNetServerOptions 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.
public NetServer listen(int port)
NetServerNetServerOptions 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.
public NetServer listen(int port, Handler<AsyncResult<NetServer>> listenHandler)
NetServerNetServer.listen(int) but providing a handler that will be notified when the server is listening, or fails.public NetServer listen()
NetServerNetServerOptions used when
creating the server.
The server may not be listening until some time after the call to listen has returned.
public NetServer listen(Handler<AsyncResult<NetServer>> listenHandler)
NetServerNetServer.listen() but providing a handler that will be notified when the server is listening, or fails.public NetServer listen(int port, String host, Handler<AsyncResult<NetServer>> listenHandler)
NetServerNetServer.listen(int, String) but providing a handler that will be notified when the server is listening, or fails.public void close()
NetServerpublic void close(Handler<AsyncResult<Void>> done)
NetServerNetServer.close() but supplying a handler that will be notified when close is complete.public int actualPort()
NetServeractualPort in interface NetServerpublic boolean isMetricsEnabled()
MeasuredisMetricsEnabled in interface Measuredpublic Metrics getMetrics()
MetricsProvidergetMetrics in interface MetricsProviderCopyright © 2015. All Rights Reserved.