vertx / io.vertx.rxjava.core.net / NetClient / connect

# connect

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

Open a connection to a server at the specific `port` and `host`.

`host` can be a valid host name or IP address. The connect is done asynchronously and on success, a io.vertx.rxjava.core.net.NetSocket instance is supplied via the `connectHandler` instance

### Parameters

`port` - the port

`host` - the host

`connectHandler` -

Return
a reference to this, so the API can be used fluently

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

Open a connection to a server at the specific `port` and `host`.

`host` can be a valid host name or IP address. The connect is done asynchronously and on success, a io.vertx.rxjava.core.net.NetSocket instance is supplied via the `connectHandler` instance

### Parameters

`port` - the port

`host` - the host

`serverName` - the SNI server name

`connectHandler` -

Return
a reference to this, so the API can be used fluently

`open fun connect(remoteAddress: SocketAddress, connectHandler: Handler<AsyncResult<NetSocket>>): NetClient`

Open a connection to a server at the specific `remoteAddress`.

The connect is done asynchronously and on success, a io.vertx.rxjava.core.net.NetSocket instance is supplied via the `connectHandler` instance

### Parameters

`remoteAddress` - the remote address

`connectHandler` -

Return
a reference to this, so the API can be used fluently

`open fun connect(remoteAddress: SocketAddress, serverName: String, connectHandler: Handler<AsyncResult<NetSocket>>): NetClient`

Open a connection to a server at the specific `remoteAddress`.

The connect is done asynchronously and on success, a io.vertx.rxjava.core.net.NetSocket instance is supplied via the `connectHandler` instance

### Parameters

`remoteAddress` - the remote address

`serverName` - the SNI server name

`connectHandler` -

Return
a reference to this, so the API can be used fluently