Class List Method List File List

# Class: Vertx::NetClient

Inherits:
  Object
  - Object
  - Vertx::NetClient
  show all
Includes:
  Measured
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/net_client.rb

## Instance Method Summary (collapse)

- - (Object) close
- - (Object) connect(port = nil, host = nil)
- - (NetClient) initialize(j_del) constructor
  A new instance of NetClient.
- - (Object) j_del
- - (Boolean) metrics_enabled?

## Constructor Details

### - (`NetClient`) initialize(j_del)

Returns a new instance of NetClient

    16
    17
    18
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/net_client.rb', line 16

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) close

Raises:

- (`ArgumentError`)

    52
    53
    54
    55
    56
    57
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/net_client.rb', line 52

    def close
      if !block_given?
        return @j_del.java_method(:close, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling close()"
    end

### - (`Object`) connect(port = nil, host = nil)

Raises:

- (`ArgumentError`)

    40
    41
    42
    43
    44
    45
    46
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/net_client.rb', line 40

    def connect(port=nil,host=nil)
      if port.class == Fixnum && host.class == String && block_given?
        @j_del.java_method(:connect, [Java::int.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(port,host,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::NetSocket) : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling connect(port,host)"
    end

### - (`Object`) j_del

    21
    22
    23
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/net_client.rb', line 21

    def j_del
      @j_del
    end

### - (`Boolean`) metrics_enabled?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    26
    27
    28
    29
    30
    31
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/net_client.rb', line 26

    def metrics_enabled?
      if !block_given?
        return @j_del.java_method(:isMetricsEnabled, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling metrics_enabled?()"
    end