public abstract class AbstractSocketChannelConnection
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
receiveBufferSizeHint |
protected int |
sendBufferSizeHint |
protected java.nio.channels.SocketChannel |
socketChannel |
| Constructor and Description |
|---|
AbstractSocketChannelConnection(int sendBufferSizeHint,
int receiveBufferSizeHint,
org.slf4j.Logger log) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect(java.lang.String hostname,
int port) |
void |
disconnect() |
boolean |
isConnected() |
protected abstract java.nio.channels.SocketChannel |
openChannel(java.lang.String hostname,
int port) |
protected void |
setBufferSizes(java.nio.channels.SocketChannel socketChannel) |
boolean |
tryFinishConnect() |
int |
writeFrom(java.nio.ByteBuffer byteBuffer) |
protected final int sendBufferSizeHint
protected final int receiveBufferSizeHint
protected java.nio.channels.SocketChannel socketChannel
public AbstractSocketChannelConnection(int sendBufferSizeHint,
int receiveBufferSizeHint,
org.slf4j.Logger log)
public void connect(java.lang.String hostname,
int port)
throws java.io.IOException
java.io.IOExceptionprotected abstract java.nio.channels.SocketChannel openChannel(java.lang.String hostname,
int port)
throws java.io.IOException
java.io.IOExceptionpublic void disconnect()
throws java.io.IOException
java.io.IOExceptionpublic int writeFrom(java.nio.ByteBuffer byteBuffer)
throws java.io.IOException
java.io.IOExceptionpublic boolean isConnected()
protected void setBufferSizes(java.nio.channels.SocketChannel socketChannel)
throws java.io.IOException
java.io.IOExceptionpublic boolean tryFinishConnect()
throws java.io.IOException
java.io.IOException