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)
NetServer
NetSocket
and passes it to the
connect handler.connectHandler
in interface NetServer
public Handler<NetSocket> connectHandler()
connectHandler
in interface NetServer
public NetSocketStream connectStream()
NetServer
NetSocket
and passes it to the
connect stream ReadStream.handler(io.vertx.core.Handler)
.connectStream
in interface NetServer
public NetServer listen(int port, String host)
NetServer
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.
public NetServer listen(int port)
NetServer
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.
public NetServer listen(int port, Handler<AsyncResult<NetServer>> listenHandler)
NetServer
NetServer.listen(int)
but providing a handler that will be notified when the server is listening, or fails.public NetServer listen()
NetServer
NetServerOptions
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)
NetServer
NetServer.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)
NetServer
NetServer.listen(int, String)
but providing a handler that will be notified when the server is listening, or fails.public void close()
NetServer
public void close(Handler<AsyncResult<Void>> done)
NetServer
NetServer.close()
but supplying a handler that will be notified when close is complete.public int actualPort()
NetServer
actualPort
in interface NetServer
public boolean isMetricsEnabled()
Measured
isMetricsEnabled
in interface Measured
public Metrics getMetrics()
MetricsProvider
getMetrics
in interface MetricsProvider
Copyright © 2015. All Rights Reserved.