new NetClient()
A TCP/SSL 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:
Extends
- module:vertx/ssl_support~SSLSupport
- module:vertx/ssl_support~ClientSSLSupport
- module:vertx/tcp_support~TCPSupport
Methods
-
close()
-
Close the client.
- Source:
-
connect(port, host, connectHandler) → {module:vertx/net.NetClient}
-
Attempt to open a connection to a server at the specific port and host. The connect is done asynchronously and on success, a
module:vertx/net.NetSocket
instance is supplied via theConnectHandler
instanceParameters:
Name Type Argument Description port
number The port to connect on host
string <optional>
The hostname or IP address to connect to (default: localhost) connectHandler
ConnectHandler <optional>
The handler receiving the connection - Source:
Returns:
this -
connectTimeout(timeout) → {number|module:vertx/net.NetClient}
-
Get or set the connect timeout, in milliseconds.
Parameters:
Name Type Argument Description timeout
number <optional>
the number of milliseconds to wait before timing out a connection - Source:
Returns:
- Type
- number | module:vertx/net.NetClient
-
keyStorePassword(password) → {boolean|Object}
-
Get or set the current keystore password for this object.
Parameters:
Name Type Argument Description password
string <optional>
If provided, sets the keystore password - Inherited From:
- Source:
Returns:
the current password, orthis
.- Type
- boolean | Object
-
keyStorePath(path) → {boolean|Object}
-
Get or set the current keystore path for this object.
Parameters:
Name Type Argument Description path
string <optional>
If provided, sets the keystore path - Inherited From:
- Source:
Returns:
the current path, orthis
.- Type
- boolean | Object
-
receiveBufferSize(size) → {number|Object}
-
Set or get the receive buffer size
Parameters:
Name Type Argument Description size
number <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- number | Object
-
reconnectAttempts(attempts) → {number|module:vertx/net.NetClient}
-
Get or set the number of reconnection attempts. Default value is zero.
Parameters:
Name Type Argument Description attempts
number <optional>
the number of reconnection attempts to make before failing - Source:
Returns:
- Type
- number | module:vertx/net.NetClient
-
reconnectInterval(interval) → {number|module:vertx/net.NetClient}
-
Get or set the reconnection interval, in milliseconds.
Parameters:
Name Type Argument Description interval
number <optional>
the number of milliseconds to wait before attempting a reconnection - Source:
Returns:
- Type
- number | module:vertx/net.NetClient
-
reuseAddress(reuse) → {boolean|Object}
-
Set or get the TCP reuse address value
Parameters:
Name Type Argument Description reuse
boolean <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- boolean | Object
-
sendBufferSize(size) → {number|Object}
-
Set or get the send buffer size
Parameters:
Name Type Argument Description size
number <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- number | Object
-
soLinger(linger) → {boolean|Object}
-
Set or get the TCP so linger value
Parameters:
Name Type Argument Description linger
boolean <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- boolean | Object
-
ssl(ssl) → {boolean|Object}
-
Get or set the current SSL support for this object.
Parameters:
Name Type Argument Description ssl
boolean <optional>
If provided, sets whether this object supports SSL - Inherited From:
- Source:
Returns:
the current status, orthis
.- Type
- boolean | Object
-
tcpKeepAlive(keepAlive) → {boolean|Object}
-
Set or get the TCP keep-alive value
Parameters:
Name Type Argument Description keepAlive
boolean <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- boolean | Object
-
tcpNoDelay(nodelay) → {boolean|Object}
-
Set or get the TCP no delay value.
Parameters:
Name Type Argument Description nodelay
boolean <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- boolean | Object
-
trafficClass(class) → {number|Object}
-
Set or get the TCP traffic class
Parameters:
Name Type Argument Description class
number <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- number | Object
-
trustAll(all) → {boolean|Object}
-
Get or set the trustAll SSL attribute
Parameters:
Name Type Argument Description all
boolean <optional>
If provided, sets the trustAll attribute - Inherited From:
- Source:
Returns:
the current trustAll status, orthis
- Type
- boolean | Object
-
trustStorePassword(password) → {boolean|Object}
-
Get or set the current trust store password for this object.
Parameters:
Name Type Argument Description password
string <optional>
If provided, sets the trust store password - Inherited From:
- Source:
Returns:
the current password, orthis
.- Type
- boolean | Object
-
trustStorePath(path) → {boolean|Object}
-
Get or set the current trust store path for this object.
Parameters:
Name Type Argument Description path
string <optional>
If provided, sets the trust store path - Inherited From:
- Source:
Returns:
the current path, orthis
.- Type
- boolean | Object
-
usePooledBuffers(use) → {boolean|Object}
-
Set or get if vertx should use pooled buffers for performance reasons. Doing so will give the best throughput but may need a bit higher memory footprint.
Parameters:
Name Type Argument Description use
boolean <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- boolean | Object