public class MqttServer extends Object
You can accept incoming MQTT connection requests providing a endpointHandler(io.vertx.core.Handler<io.vertx.reactivex.mqtt.MqttEndpoint>)
. As the
requests arrive, the handler will be called with an instance of MqttEndpoint
in order to manage the
communication with the remote MQTT client.
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<MqttServer> |
__TYPE_ARG |
Constructor and Description |
---|
MqttServer(MqttServer delegate) |
MqttServer(Object delegate) |
Modifier and Type | Method and Description |
---|---|
int |
actualPort()
The actual port the server is listening on.
|
void |
close()
Close the server supplying an handler that will be called when the server is actually closed (or has failed).
|
void |
close(Handler<AsyncResult<Void>> completionHandler)
Close the server supplying an handler that will be called when the server is actually closed (or has failed).
|
static MqttServer |
create(Vertx vertx)
Return an MQTT server instance using default options
|
static MqttServer |
create(Vertx vertx,
MqttServerOptions options)
Return an MQTT server instance
|
MqttServer |
endpointHandler(Handler<MqttEndpoint> handler)
Set the endpoint handler for the server.
|
boolean |
equals(Object o) |
MqttServer |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler for the server, that will be called when an error happens independantly of an
accepted
MqttEndpoint , like a rejected connection |
MqttServer |
getDelegate() |
int |
hashCode() |
MqttServer |
listen()
Start the server listening for incoming connections using the specified options
through the constructor
|
MqttServer |
listen(Handler<AsyncResult<MqttServer>> listenHandler)
Start the server listening for incoming connections using the specified options
through the constructor
|
MqttServer |
listen(int port)
Start the server listening for incoming connections on the port specified but on
"0.0.0.0" as host.
|
MqttServer |
listen(int port,
Handler<AsyncResult<MqttServer>> listenHandler)
Start the server listening for incoming connections on the port specified but on
"0.0.0.0" as host.
|
MqttServer |
listen(int port,
String host)
Start the server listening for incoming connections on the port and host specified
It ignores any options specified through the constructor
|
MqttServer |
listen(int port,
String host,
Handler<AsyncResult<MqttServer>> listenHandler)
Start the server listening for incoming connections on the port and host specified
It ignores any options specified through the constructor
|
static MqttServer |
newInstance(MqttServer arg) |
Completable |
rxClose()
Close the server supplying an handler that will be called when the server is actually closed (or has failed).
|
Single<MqttServer> |
rxListen()
Start the server listening for incoming connections using the specified options
through the constructor
|
Single<MqttServer> |
rxListen(int port)
Start the server listening for incoming connections on the port specified but on
"0.0.0.0" as host.
|
Single<MqttServer> |
rxListen(int port,
String host)
Start the server listening for incoming connections on the port and host specified
It ignores any options specified through the constructor
|
String |
toString() |
public static final io.vertx.lang.rx.TypeArg<MqttServer> __TYPE_ARG
public MqttServer(MqttServer delegate)
public MqttServer(Object delegate)
public MqttServer getDelegate()
public static MqttServer create(Vertx vertx, MqttServerOptions options)
vertx
- Vert.x instanceoptions
- MQTT server optionspublic static MqttServer create(Vertx vertx)
vertx
- Vert.x instancepublic MqttServer listen(int port, String host, Handler<AsyncResult<MqttServer>> listenHandler)
port
- the port to listen onhost
- the host to listen onlistenHandler
- handler called when the asynchronous listen call endspublic MqttServer listen(int port, String host)
port
- the port to listen onhost
- the host to listen onpublic Single<MqttServer> rxListen(int port, String host)
port
- the port to listen onhost
- the host to listen onpublic MqttServer listen(int port, Handler<AsyncResult<MqttServer>> listenHandler)
port
- the port to listen onlistenHandler
- handler called when the asynchronous listen call endspublic MqttServer listen(int port)
port
- the port to listen onpublic Single<MqttServer> rxListen(int port)
port
- the port to listen onpublic MqttServer listen(Handler<AsyncResult<MqttServer>> listenHandler)
listenHandler
- handler called when the asynchronous listen call endspublic MqttServer listen()
public Single<MqttServer> rxListen()
public MqttServer endpointHandler(Handler<MqttEndpoint> handler)
handler
- the endpoint handlerpublic MqttServer exceptionHandler(Handler<Throwable> handler)
MqttEndpoint
, like a rejected connectionhandler
- the exception handlerpublic int actualPort()
public void close(Handler<AsyncResult<Void>> completionHandler)
completionHandler
- the handler called on completionpublic void close()
public Completable rxClose()
public static MqttServer newInstance(MqttServer arg)
Copyright © 2024 Eclipse. All rights reserved.