public class DefaultSocketConnector extends java.lang.Object implements SocketConnector
SocketConnector.SocketConnector.ExceptionHandler| Constructor and Description |
|---|
DefaultSocketConnector(java.net.InetAddress address,
int port,
DelayStrategy delayStrategy)
Constructs a new connector.
|
DefaultSocketConnector(java.net.InetAddress address,
int port,
long initialDelay,
long retryDelay)
Constructs a new connector.
|
| Modifier and Type | Method and Description |
|---|---|
java.net.Socket |
call()
Loops until the desired connection is established and returns the resulting connector.
|
void |
setExceptionHandler(SocketConnector.ExceptionHandler exceptionHandler)
Sets the connector's exception handler.
|
void |
setSocketFactory(javax.net.SocketFactory socketFactory)
Sets the connector's socket factory.
|
public DefaultSocketConnector(java.net.InetAddress address,
int port,
long initialDelay,
long retryDelay)
address - address of remote listenerport - port of remote listenerinitialDelay - delay before initial connection attemptretryDelay - delay after failed connection attemptpublic DefaultSocketConnector(java.net.InetAddress address,
int port,
DelayStrategy delayStrategy)
address - address of remote listenerport - port of remote listenerdelayStrategy - strategy for choosing the delay to impose before
each connection attemptpublic java.net.Socket call()
throws java.lang.InterruptedException
call in interface SocketConnectorcall in interface java.util.concurrent.Callable<java.net.Socket>java.lang.InterruptedExceptionpublic void setExceptionHandler(SocketConnector.ExceptionHandler exceptionHandler)
The handler must be set before the SocketConnector.call() method is invoked.
setExceptionHandler in interface SocketConnectorexceptionHandler - the handler to setpublic void setSocketFactory(javax.net.SocketFactory socketFactory)
If no factory is configured that connector will use the platform's default factory.
setSocketFactory in interface SocketConnectorsocketFactory - the factory to setCopyright © 2010 - 2023 Adobe. All Rights Reserved