Package: io.vertx.groovy.core.net

## [Groovy] Class NetClient

- io.vertx.groovy.core.net.NetClient

- All Implemented Interfaces and Traits:
    Measured

      @groovy.transform.CompileStatic
      class NetClient
      extends java.lang.Object

  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.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `NetClient (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `close()` Close the client.
    `NetClient` | `connect(int port, java.lang.String host, io.vertx.core.Handler<io.vertx.core.AsyncResult<NetSocket>> connectHandler)` Open a connection to a server at the specific `port` and `host`.
    `java.lang.Object` | `getDelegate()`
    `boolean` | `isMetricsEnabled()` Whether the metrics are enabled for this measured object

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### NetClient(java.lang.Object delegate)

  - ### Method Detail

    - #### void 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.

    - #### NetClient connect(int port, java.lang.String host, io.vertx.core.Handler<io.vertx.core.AsyncResult<NetSocket>> connectHandler)

      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

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `port` - the port
        `host` - the host
        connectHandler

    - #### java.lang.Object getDelegate()

    - #### boolean isMetricsEnabled()

      Whether the metrics are enabled for this measured object

      Returns:
        true if the metrics are enabled