public class NetClient extends Object implements Measured
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 theoriginal
non RX-ified interface using Vert.x codegen.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 . |
Observable<NetSocket> |
connectObservable(int port,
String host)
Open a connection to a server at the specific
port and host . |
Object |
getDelegate() |
boolean |
isMetricsEnabled()
Whether the metrics are enabled for this measured object
|
static NetClient |
newInstance(NetClient arg) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newInstance
public NetClient(NetClient delegate)
public Object getDelegate()
getDelegate
in interface Measured
public boolean isMetricsEnabled()
isMetricsEnabled
in interface Measured
public NetClient connect(int port, String host, Handler<AsyncResult<NetSocket>> connectHandler)
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 hostconnectHandler
- public Observable<NetSocket> connectObservable(int port, String host)
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 hostpublic void close()
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.
Copyright © 2016. All rights reserved.