public abstract class RobustIPConnection extends RobustConnection
Helper class for handling automatic reconnections to hosts on IP networks
Modifier and Type | Field and Description |
---|---|
protected boolean |
checkReachability |
connectConfig, connected, module, remoteServiceName, waitThread
Constructor and Description |
---|
RobustIPConnection(AbstractModule<?> module,
RobustIPConnectionConfig config,
String remoteServiceName) |
Modifier and Type | Method and Description |
---|---|
boolean |
tryConnect(String host)
Try to ping host with ICMP packets (must be root)
|
boolean |
tryConnectTCP(String host,
int port)
Try to connect to host on given TCP port
|
cancel, isConnected, reconnect, tryConnect, updateConfig, waitForConnection
public RobustIPConnection(AbstractModule<?> module, RobustIPConnectionConfig config, String remoteServiceName)
public boolean tryConnect(String host) throws IOException
host
- host name or address to connect toIOException
- if connection was unsuccessful and shouldn't be retriedpublic boolean tryConnectTCP(String host, int port) throws IOException
host
- host name or address to connect toport
- TCP port to connect toIOException
- if connection was unsuccessful and shouldn't be retriedCopyright © 2016 Sensia Software LLC. All rights reserved.