public class SocketIODelegate extends java.lang.Object implements DriverIODelegate
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SO_TIMEOUT |
static int |
DEFAULT_TIMEOUT |
Constructor and Description |
---|
SocketIODelegate(AbstractIODelegatingDriver driver,
java.lang.String hostname,
int port) |
SocketIODelegate(AbstractIODelegatingDriver driver,
java.lang.String hostname,
int port,
int timeout,
int soTimeout) |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Connect to the underlying IO source.
|
void |
disconnect()
Disconnect from the underlying IO source.
|
void |
onNotifyConnectFailed(java.lang.Exception connectError)
AbstractDriver.notifyConnectFailed(Exception) was intercepted by AbstractIODelegatingDriver . |
void |
onNotifyConnectionLost()
AbstractDriver.notifyConnectionLost() was intercepted by AbstractIODelegatingDriver . |
void |
onNotifyConnectSucceeded()
AbstractDriver.notifyConnectSucceeded() was intercepted by AbstractIODelegatingDriver . |
void |
onNotifyDisconnectDone()
AbstractDriver.notifyDisconnectDone() was intercepted by AbstractIODelegatingDriver . |
void |
writeToIO(java.nio.ByteBuffer... buffers)
Write data to the underlying IO source.
|
public static final int DEFAULT_TIMEOUT
public static final int DEFAULT_SO_TIMEOUT
public SocketIODelegate(AbstractIODelegatingDriver driver, java.lang.String hostname, int port)
public SocketIODelegate(AbstractIODelegatingDriver driver, java.lang.String hostname, int port, int timeout, int soTimeout)
public void connect() throws java.io.IOException
DriverIODelegate
connect
in interface DriverIODelegate
java.io.IOException
- Any IOException
thrown during connect will result in a call to AbstractDriver.notifyConnectFailed(Exception)
and the rest of the connection sequence will be aborted.
Implementations do not need to make this call themselves.public void disconnect()
DriverIODelegate
disconnect
in interface DriverIODelegate
public void writeToIO(java.nio.ByteBuffer... buffers)
DriverIODelegate
writeToIO
in interface DriverIODelegate
buffers
- Data to write.public void onNotifyConnectSucceeded()
DriverIODelegate
AbstractDriver.notifyConnectSucceeded()
was intercepted by AbstractIODelegatingDriver
.onNotifyConnectSucceeded
in interface DriverIODelegate
public void onNotifyConnectFailed(java.lang.Exception connectError)
DriverIODelegate
AbstractDriver.notifyConnectFailed(Exception)
was intercepted by AbstractIODelegatingDriver
.onNotifyConnectFailed
in interface DriverIODelegate
connectError
- The error associated with the connect failure.public void onNotifyConnectionLost()
DriverIODelegate
AbstractDriver.notifyConnectionLost()
was intercepted by AbstractIODelegatingDriver
.onNotifyConnectionLost
in interface DriverIODelegate
public void onNotifyDisconnectDone()
DriverIODelegate
AbstractDriver.notifyDisconnectDone()
was intercepted by AbstractIODelegatingDriver
.onNotifyDisconnectDone
in interface DriverIODelegate