public class NIOTCPInputConnection
extends java.lang.Object
implements java.io.Closeable
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
msg
The current result message.
|
protected int |
msg_len
The current message length (-1 for none).
|
protected int |
msg_pos
The msg pos.
|
protected java.nio.ByteBuffer |
rb
The read buffer for reading out the messages.
|
protected java.nio.channels.SocketChannel |
sc
The socket channel for receiving messages.
|
protected java.nio.ByteBuffer |
wb
The write buffer for the channel.
|
| Constructor and Description |
|---|
NIOTCPInputConnection(java.nio.channels.SocketChannel sc)
Constructor for InputConnection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection.
|
byte[] |
read()
Read a message from the channel.
|
java.lang.String |
toString()
A string representation.
|
protected java.nio.channels.SocketChannel sc
protected java.nio.ByteBuffer wb
protected java.nio.ByteBuffer rb
protected int msg_len
protected byte[] msg
protected int msg_pos
public NIOTCPInputConnection(java.nio.channels.SocketChannel sc)
sc - dec - java.io.IOExceptionpublic byte[] read()
throws java.io.IOException
java.lang.Exception - on read error.java.io.IOExceptionpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic java.lang.String toString()
toString in class java.lang.Object