public class SocketInternetObservingStrategy extends java.lang.Object implements InternetObservingStrategy
| Constructor and Description |
|---|
SocketInternetObservingStrategy() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isConnected(java.net.Socket socket,
java.lang.String host,
int port,
int timeoutInMs,
ErrorHandler errorHandler)
checks if device is connected to given host at given port
|
boolean |
isConnected(java.lang.String host,
int port,
int timeoutInMs,
ErrorHandler errorHandler)
checks if device is connected to given host at given port
|
<any> |
observeInternetConnectivity(int initialIntervalInMs,
int intervalInMs,
java.lang.String host,
int port,
int timeoutInMs,
ErrorHandler errorHandler)
Observes connectivity with the Internet by opening socket connection with remote host
|
public <any> observeInternetConnectivity(int initialIntervalInMs,
int intervalInMs,
java.lang.String host,
int port,
int timeoutInMs,
ErrorHandler errorHandler)
observeInternetConnectivity in interface InternetObservingStrategyinitialIntervalInMs - in milliseconds determining the delay of the first connectivity
checkintervalInMs - in milliseconds determining how often we want to check connectivityhost - for checking Internet connectivityport - for checking Internet connectivitytimeoutInMs - for pinging remote host in millisecondserrorHandler - for handling errors while closing socketpublic boolean isConnected(java.lang.String host,
int port,
int timeoutInMs,
ErrorHandler errorHandler)
host - to connectport - to connecttimeoutInMs - connection timeouterrorHandler - error handler for socket connectionpublic boolean isConnected(java.net.Socket socket,
java.lang.String host,
int port,
int timeoutInMs,
ErrorHandler errorHandler)
socket - to connecthost - to connectport - to connecttimeoutInMs - connection timeouterrorHandler - error handler for socket connection