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.IOException
public byte[] read() throws java.io.IOException
java.lang.Exception
- on read error.java.io.IOException
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public java.lang.String toString()
toString
in class java.lang.Object