vertx / io.vertx.rxjava.mqtt / MqttClient / connect

# connect

`open fun connect(port: Int, host: String, connectHandler: Handler<AsyncResult<MqttConnAckMessage>>): MqttClient`

Connects to an MQTT server calling connectHandler after connection

### Parameters

`port` - port of the MQTT server

`host` - hostname/ip address of the MQTT server

`connectHandler` - handler called when the asynchronous connect call ends

Return
current MQTT client instance

`open fun connect(port: Int, host: String, serverName: String, connectHandler: Handler<AsyncResult<MqttConnAckMessage>>): MqttClient`

Connects to an MQTT server calling connectHandler after connection

### Parameters

`port` - port of the MQTT server

`host` - hostname/ip address of the MQTT server

`serverName` - the SNI server name

`connectHandler` - handler called when the asynchronous connect call ends

Return
current MQTT client instance