io.vertx.rxjava.core.net

## Class NetClient

- java.lang.Object
- - io.vertx.rxjava.core.net.NetClient

- All Implemented Interfaces:
    Measured

      public class NetClient
      extends Object
      implements Measured

  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.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static TypeArg<NetClient>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetClient(NetClient delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close the client.
    `NetClient` | `connect(int port, String host, Handler<AsyncResult<NetSocket>> connectHandler)` Open a connection to a server at the specific `port` and `host`.
    `rx.Observable<NetSocket>` | `connectObservable(int port, String host)` Deprecated. use `rxConnect(int, java.lang.String)` instead
    `NetClient` | `getDelegate()`
    `boolean` | `isMetricsEnabled()` Whether the metrics are enabled for this measured object
    `static NetClient` | `newInstance(NetClient arg)`
    `rx.Single<NetSocket>` | `rxConnect(int port, String host)` Open a connection to a server at the specific `port` and `host`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface io.vertx.rxjava.core.metrics.Measured

      `newInstance`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final TypeArg<NetClient> __TYPE_ARG

  - ### Constructor Detail

    - #### NetClient

          public NetClient(NetClient delegate)

  - ### Method Detail

    - #### getDelegate

          public NetClient getDelegate()

      Specified by:
        `getDelegate` in interface `Measured`

    - #### isMetricsEnabled

          public boolean isMetricsEnabled()

      Whether the metrics are enabled for this measured object
      Specified by:
        `isMetricsEnabled` in interface `Measured`
      Returns:
        true if the metrics are enabled

    - #### connect

          public NetClient connect(int port,
                                   String host,
                                   Handler<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

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

    - #### connectObservable

          @Deprecated
          public rx.Observable<NetSocket> connectObservable(int port,
                                                                        String host)

      Deprecated. use `rxConnect(int, java.lang.String)` instead
      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:
        `port` - the port
        `host` - the host
      Returns:

    - #### rxConnect

          public rx.Single<NetSocket> rxConnect(int port,
                                                String host)

      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:
        `port` - the port
        `host` - the host
      Returns:

    - #### close

          public 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.

    - #### newInstance

          public static NetClient newInstance(NetClient arg)

Copyright © 2017. All rights reserved.