Package io.vertx.rxjava.core.net
Class NetServer
- java.lang.Object
-
- io.vertx.rxjava.core.net.NetServer
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<NetServer>
__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
actualPort()
The actual port the server is listening on.void
close()
Likeclose(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but supplying a handler that will be notified when close is complete.void
close(Handler<AsyncResult<Void>> completionHandler)
Likeclose(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but supplying a handler that will be notified when close is complete.NetServer
connectHandler(Handler<NetSocket> handler)
Supply a connect handler for this server.ReadStream<NetSocket>
connectStream()
Return the connect stream for this server.boolean
equals(Object o)
NetServer
getDelegate()
int
hashCode()
boolean
isMetricsEnabled()
Whether the metrics are enabled for this measured objectNetServer
listen()
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.NetServer
listen(int port)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.NetServer
listen(int port, Handler<AsyncResult<NetServer>> listenHandler)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.NetServer
listen(int port, String host)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.NetServer
listen(int port, String host, Handler<AsyncResult<NetServer>> listenHandler)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.NetServer
listen(Handler<AsyncResult<NetServer>> listenHandler)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.NetServer
listen(SocketAddress localAddress)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.NetServer
listen(SocketAddress localAddress, Handler<AsyncResult<NetServer>> listenHandler)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.static NetServer
newInstance(NetServer arg)
rx.Single<Void>
rxClose()
Likeclose(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but supplying a handler that will be notified when close is complete.rx.Single<NetServer>
rxListen()
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.rx.Single<NetServer>
rxListen(int port)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.rx.Single<NetServer>
rxListen(int port, String host)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.rx.Single<NetServer>
rxListen(SocketAddress localAddress)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.String
toString()
-
-
-
Method Detail
-
getDelegate
public NetServer getDelegate()
- Specified by:
getDelegate
in interfaceMeasured
-
isMetricsEnabled
public boolean isMetricsEnabled()
Whether the metrics are enabled for this measured object- Specified by:
isMetricsEnabled
in interfaceMeasured
- Returns:
true
if metrics are enabled
-
connectStream
public ReadStream<NetSocket> connectStream()
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 ofNetSocket
and passes it to the connect stream .- Returns:
- the connect stream
-
connectHandler
public NetServer connectHandler(Handler<NetSocket> handler)
Supply 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 ofNetSocket
and passes it to the connect handler.- Parameters:
handler
-- Returns:
- a reference to this, so the API can be used fluently
-
listen
public NetServer listen(Handler<AsyncResult<NetServer>> listenHandler)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.- Parameters:
listenHandler
- handler that will be notified when listening or failed- Returns:
- a reference to this, so the API can be used fluently
-
listen
public NetServer listen()
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.- Returns:
- a reference to this, so the API can be used fluently
-
rxListen
public rx.Single<NetServer> rxListen()
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.- Returns:
- a reference to this, so the API can be used fluently
-
listen
public NetServer listen(int port, String host, Handler<AsyncResult<NetServer>> listenHandler)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.- Parameters:
port
- the port to listen onhost
- the host to listen onlistenHandler
- handler that will be notified when listening or failed- Returns:
- a reference to this, so the API can be used fluently
-
listen
public NetServer listen(int port, String host)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.- Parameters:
port
- the port to listen onhost
- the host to listen on- Returns:
- a reference to this, so the API can be used fluently
-
rxListen
public rx.Single<NetServer> rxListen(int port, String host)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.- Parameters:
port
- the port to listen onhost
- the host to listen on- Returns:
- a reference to this, so the API can be used fluently
-
listen
public NetServer listen(int port, Handler<AsyncResult<NetServer>> listenHandler)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.- Parameters:
port
- the port to listen onlistenHandler
- handler that will be notified when listening or failed- Returns:
- a reference to this, so the API can be used fluently
-
listen
public NetServer listen(int port)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.- Parameters:
port
- the port to listen on- Returns:
- a reference to this, so the API can be used fluently
-
rxListen
public rx.Single<NetServer> rxListen(int port)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.- Parameters:
port
- the port to listen on- Returns:
- a reference to this, so the API can be used fluently
-
listen
public NetServer listen(SocketAddress localAddress, Handler<AsyncResult<NetServer>> listenHandler)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.- Parameters:
localAddress
- the local address to listen onlistenHandler
- handler that will be notified when listening or failed- Returns:
- a reference to this, so the API can be used fluently
-
listen
public NetServer listen(SocketAddress localAddress)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.- Parameters:
localAddress
- the local address to listen on- Returns:
- a reference to this, so the API can be used fluently
-
rxListen
public rx.Single<NetServer> rxListen(SocketAddress localAddress)
Likelisten(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.core.net.NetServer>>)
but providing a handler that will be notified when the server is listening, or fails.- Parameters:
localAddress
- the local address to listen on- Returns:
- a reference to this, so the API can be used fluently
-
close
public void close(Handler<AsyncResult<Void>> completionHandler)
Likeclose(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but supplying a handler that will be notified when close is complete.- Parameters:
completionHandler
- the handler
-
close
public void close()
Likeclose(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but supplying a handler that will be notified when close is complete.
-
rxClose
public rx.Single<Void> rxClose()
Likeclose(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but supplying a handler that will be notified when close is complete.- Returns:
-
actualPort
public int actualPort()
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- Returns:
- the actual port the server is listening on.
-
-