com.crankuptheamps.client
Class TCPTransportImpl
java.lang.Object
com.crankuptheamps.client.TCPTransportImpl
public class TCPTransportImpl
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_socket
protected SocketChannel _socket
_lock
public final Lock _lock
_filter
protected TransportFilter _filter
TCPTransportImpl
public TCPTransportImpl(Protocol messageType,
Properties properties,
TransportFilter filter)
setMessageHandler
public void setMessageHandler(MessageHandler h)
setDisconnectHandler
public void setDisconnectHandler(TransportDisconnectHandler h)
setExceptionListener
public void setExceptionListener(ExceptionListener exceptionListener)
setTransportFilter
public void setTransportFilter(TransportFilter filter)
connect
public void connect(URI addr)
throws ConnectionRefusedException,
AlreadyConnectedException,
InvalidURIException
- Throws:
ConnectionRefusedException
AlreadyConnectedException
InvalidURIException
createSocket
protected SocketChannel createSocket()
throws IOException
- Throws:
IOException
disconnect
public void disconnect()
send
public void send(ByteBuffer buf)
throws DisconnectedException
- Throws:
DisconnectedException
socket
public Socket socket()
writeQueueSize
public long writeQueueSize()
readQueueSize
public long readQueueSize()
flush
public long flush()
flush
public long flush(long timeout)
handleCloseEvent
public void handleCloseEvent(int failedVersion,
String message,
Exception e_)
throws RetryOperationException,
DisconnectedException
- Throws:
RetryOperationException
DisconnectedException
setReadTimeout
public void setReadTimeout(int readTimeoutMillis_)