# Class: NetClient

## vertx-js/net_client~ NetClient

#### new NetClient()

  A TCP client.

  Multiple connections to different servers can be made using the same instance.

  This client supports a configurable number of connection attempts and a configurable delay between attempts.

  Source:
    - net_client.js, line 36

### Methods

#### close()

  Close the client.

  Any sockets which have not been closed manually will be closed here. The close is asynchronous and may not complete until some time after the method has returned.

  Source:
    - net_client.js, line 91

#### connect(port, host, connectHandler) → {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 NetSocket instance is supplied via the `connectHandler` instance

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | number | the port
  `host` | string | the host
  `connectHandler` | function |

  Source:
    - net_client.js, line 68

  ##### Returns:

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

#### isMetricsEnabled() → {boolean}

  Whether the metrics are enabled for this measured object
  Source:
    - net_client.js, line 49

  ##### Returns:

  true if the metrics are enabled
  Type
    boolean