public class DefaultSocketConnector extends Object implements SocketConnector
SocketConnector.SocketConnector.ExceptionHandler| Constructor and Description |
|---|
DefaultSocketConnector(InetAddress address,
int port,
DelayStrategy delayStrategy)
Constructs a new connector.
|
DefaultSocketConnector(InetAddress address,
int port,
long initialDelay,
long retryDelay)
Constructs a new connector.
|
| Modifier and Type | Method and Description |
|---|---|
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(SocketFactory socketFactory)
Sets the connector's socket factory.
|
public DefaultSocketConnector(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(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 Socket call() throws InterruptedException
call in interface SocketConnectorcall in interface Callable<Socket>InterruptedException - the running connection thread was cancelledpublic 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(SocketFactory socketFactory)
If no factory is configured that connector will use the platform's default factory.
setSocketFactory in interface SocketConnectorsocketFactory - the factory to setCopyright © 2005–2014 QOS.ch. All rights reserved.