vertx / io.vertx.kotlin.mqtt / io.vertx.mqtt.MqttClient / connectAwait

# connectAwait

`suspend fun MqttClient.connectAwait(port: Int, host: String): MqttConnAckMessage`

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

Returncurrent
MQTT client instance *

`suspend fun MqttClient.connectAwait(port: Int, host: String, serverName: String): MqttConnAckMessage`

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

Returncurrent
MQTT client instance *