vertx / io.vertx.rxjava.mqtt / MqttServer

MqttServer

open class MqttServer

An MQTT server

You can accept incoming MQTT connection requests providing a io.vertx.rxjava.mqtt.MqttServer#endpointHandler. As the requests arrive, the handler will be called with an instance of io.vertx.rxjava.mqtt.MqttEndpoint in order to manage the communication with the remote MQTT client.

NOTE: This class has been automatically generated from the io.vertx.mqtt.MqttServer non RX-ified interface using Vert.x codegen.

Constructors

<init>

MqttServer(delegate: MqttServer)

Properties

__TYPE_ARG

static val __TYPE_ARG: TypeArg<MqttServer>

Functions

actualPort

open fun actualPort(): Int

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

close

open fun close(): Unit

Close the server.

The close happens asynchronously and the server may not be closed until some time after the call has returned.

open fun close(completionHandler: Handler<AsyncResult<Void>>): Unit

Close the server supplying an handler that will be called when the server is actually closed (or has failed).

create

open static fun create(vertx: Vertx, options: MqttServerOptions): MqttServer

Return an MQTT server instance

open static fun create(vertx: Vertx): MqttServer

Return an MQTT server instance using default options

endpointHandler

open fun endpointHandler(handler: Handler<MqttEndpoint>): MqttServer

Set the endpoint handler for the server. If an MQTT client connect to the server a new MqttEndpoint instance will be created and passed to the handler

equals

open fun equals(other: Any?): Boolean

exceptionHandler

open fun exceptionHandler(handler: Handler<Throwable>): MqttServer

Set an exception handler for the server, that will be called when an error happens independantly of an accepted io.vertx.rxjava.mqtt.MqttEndpoint, like a rejected connection

getDelegate

open fun getDelegate(): MqttServer

hashCode

open fun hashCode(): Int

listen

open fun listen(): MqttServer
open fun listen(listenHandler: Handler<AsyncResult<MqttServer>>): MqttServer

Start the server listening for incoming connections using the specified options through the constructor

open fun listen(port: Int, host: String): MqttServer

Start the server listening for incoming connections on the port and host specified

open fun listen(port: Int, host: String, listenHandler: Handler<AsyncResult<MqttServer>>): MqttServer

Start the server listening for incoming connections on the port and host specified It ignores any options specified through the constructor

open fun listen(port: Int): MqttServer
open fun listen(port: Int, listenHandler: Handler<AsyncResult<MqttServer>>): MqttServer

Start the server listening for incoming connections on the port specified but on "0.0.0.0" as host. It ignores any options specified through the constructor

newInstance

open static fun newInstance(arg: MqttServer): MqttServer

rxClose

open fun rxClose(): Single<Void>

Close the server supplying an handler that will be called when the server is actually closed (or has failed).

rxListen

open fun rxListen(port: Int, host: String): Single<MqttServer>

Start the server listening for incoming connections on the port and host specified It ignores any options specified through the constructor

open fun rxListen(port: Int): Single<MqttServer>

Start the server listening for incoming connections on the port specified but on "0.0.0.0" as host. It ignores any options specified through the constructor

open fun rxListen(): Single<MqttServer>

Start the server listening for incoming connections using the specified options through the constructor

toString

open fun toString(): String