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>> completionHandler)
Like
NetServer but supplying a handler that will be notified when close is complete. |
rx.Observable<Void> |
closeObservable()
Like
NetServer but supplying a handler that will be notified when close is complete. |
NetServer |
connectHandler(Handler<NetSocket> handler)
Supply a connect handler for this server.
|
NetSocketStream |
connectStream()
Return the connect stream for this server.
|
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
NetServerOptions used when
creating the server. |
NetServer |
listen(Handler<AsyncResult<NetServer>> listenHandler)
Like
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
listen() 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
listen() but providing a handler that will be notified when the server is listening, or fails. |
rx.Observable<NetServer> |
listenObservable()
Like
listen() but providing a handler that will be notified when the server is listening, or fails. |
rx.Observable<NetServer> |
listenObservable(int port)
Like
listen() but providing a handler that will be notified when the server is listening, or fails. |
rx.Observable<NetServer> |
listenObservable(int port,
String host)
Like
listen() but providing a handler that will be notified when the server is listening, or fails. |
static NetServer |
newInstance(NetServer arg) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newInstance
public NetServer(NetServer delegate)
public Object getDelegate()
getDelegate
in interface Measured
public boolean isMetricsEnabled()
isMetricsEnabled
in interface Measured
public NetSocketStream connectStream()
NetSocket
and passes it to the
connect stream .public NetServer connectHandler(Handler<NetSocket> handler)
NetSocket
and passes it to the
connect handler.handler
- public NetServer listen()
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)
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 failedpublic rx.Observable<NetServer> listenObservable()
listen()
but providing a handler that will be notified when the server is listening, or fails.public 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.
port
- host
- public NetServer listen(int port, String host, Handler<AsyncResult<NetServer>> listenHandler)
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 failedpublic rx.Observable<NetServer> listenObservable(int port, String host)
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 onpublic 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.
port
- public NetServer listen(int port, Handler<AsyncResult<NetServer>> listenHandler)
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 failedpublic rx.Observable<NetServer> listenObservable(int port)
listen()
but providing a handler that will be notified when the server is listening, or fails.port
- the port to listen onpublic void close()
public void close(Handler<AsyncResult<Void>> completionHandler)
NetServer
but supplying a handler that will be notified when close is complete.completionHandler
- the handlerpublic rx.Observable<Void> closeObservable()
NetServer
but supplying a handler that will be notified when close is complete.public int actualPort()
Copyright © 2015. All Rights Reserved.