@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 and description |
---|
NetClient
(java.lang.Object delegate) |
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 |
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() |
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.
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
port
- the porthost
- the hostWhether the metrics are enabled for this measured object