Class: Vertx::NetClient
- Inherits:
-
Object
- Object
- Vertx::NetClient
- Includes:
- ClientSSLSupport, SSLSupport, TCPSupport
- Defined in:
- src/main/api_shim/core/net.rb
Overview
NetClient is an asynchronous factory for TCP or SSL connections.
Multiple connections to different servers can be made using the same instance.
Instance Method Summary (collapse)
-
- (Object) close
Close the NetClient.
-
- (NetClient) connect(port, host = "localhost", &hndlr)
Attempt to open a connection to a server.
-
- (Object) connect_timeout(val = nil)
Set or Get the connect timeout for a fluent API.
-
- (Object) connect_timeout=(val)
Set the connect timeout.
-
- (NetClient) initialize
constructor
Create a new NetClient.
-
- (Object) reconnect_attempts(val = nil)
Set or Get the reconnect attempts for a fluent API.
-
- (Object) reconnect_attempts=(val)
Set the reconnect attempts.
-
- (Object) reconnect_interval(val = nil)
Set or Get the reconnect interval for a fluent API.
-
- (Object) reconnect_interval=(val)
Set the reconnect interval.
Methods included from SSLSupport
#key_store_password, #key_store_password=, #key_store_path, #key_store_path=, #ssl, #ssl=, #trust_store_password, #trust_store_password=, #trust_store_path, #trust_store_path=
Methods included from ClientSSLSupport
Methods included from TCPSupport
#receive_buffer_size=, #reuse_address, #reuse_address=, #send_buffer_size, #send_buffer_size=, #send_receive_size, #so_linger, #so_linger=, #tcp_keep_alive, #tcp_keep_alive=, #traffic_class, #traffic_class=, #use_pooled_buffers, #use_pooled_buffers=
Constructor Details
- (NetClient) initialize
Create a new NetClient
86 87 88 |
# File 'src/main/api_shim/core/net.rb', line 86 def initialize @j_del = org.vertx.java.platform.impl.JRubyVerticleFactory.vertx.createNetClient end |
Instance Method Details
- (Object) close
Close the NetClient. Any open connections will be closed.
152 153 154 |
# File 'src/main/api_shim/core/net.rb', line 152 def close @j_del.close end |
- (NetClient) connect(port, host = "localhost", &hndlr)
Attempt to open a connection to a server. The connection is opened asynchronously and the result returned in the
handler.
Vertx::NetSocket
97 98 99 100 101 |
# File 'src/main/api_shim/core/net.rb', line 97 def connect(port, host = "localhost", &hndlr) hndlr = ARWrappedHandler.new(hndlr) { |j_socket| NetSocket.new(j_socket) } @j_del.connect(port, host, hndlr) self end |
- (Object) connect_timeout(val = nil)
Set or Get the connect timeout for a fluent API
142 143 144 145 146 147 148 149 |
# File 'src/main/api_shim/core/net.rb', line 142 def connect_timeout(val = nil) if val @j_del.setConnectTimeout(val) self else @j_del.getConnectTimeout end end |
- (Object) connect_timeout=(val)
Set the connect timeout
136 137 138 139 |
# File 'src/main/api_shim/core/net.rb', line 136 def connect_timeout=(val) @j_del.setConnectTimeout(val) self end |
- (Object) reconnect_attempts(val = nil)
Set or Get the reconnect attempts for a fluent API
110 111 112 113 114 115 116 117 |
# File 'src/main/api_shim/core/net.rb', line 110 def reconnect_attempts(val = nil) if val @j_del.setReconnectAttempts(val) self else @j_del.getReconnectAttempts end end |
- (Object) reconnect_attempts=(val)
Set the reconnect attempts
104 105 106 107 |
# File 'src/main/api_shim/core/net.rb', line 104 def reconnect_attempts=(val) @j_del.setReconnectAttempts(val) self end |
- (Object) reconnect_interval(val = nil)
Set or Get the reconnect interval for a fluent API
126 127 128 129 130 131 132 133 |
# File 'src/main/api_shim/core/net.rb', line 126 def reconnect_interval(val = nil) if val @j_del.setReconnectInterval(val) self else @j_del.getReconnectInterval end end |
- (Object) reconnect_interval=(val)
Set the reconnect interval
120 121 122 123 |
# File 'src/main/api_shim/core/net.rb', line 120 def reconnect_interval=(val) @j_del.setReconnectInterval(val) self end |