public class TcpReader
extends java.lang.Object
implements java.lang.Runnable
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentPort
Current TPC port
|
protected boolean |
debug
Debug mode
|
protected java.util.concurrent.ExecutorService |
executor
Server's executor
|
protected static org.slf4j.Logger |
logger |
protected int |
maxPacketSize
Maximum size of an incoming packet
|
protected java.nio.channels.Selector |
selector |
protected java.nio.channels.ServerSocketChannel |
serverChannel |
protected TcpTransporter |
transporter
Parent transporter
|
| Constructor and Description |
|---|
TcpReader(TcpTransporter transporter) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
close(java.nio.channels.SelectionKey key,
java.lang.Exception cause) |
void |
connect() |
void |
disconnect() |
protected void |
finalize() |
int |
getCurrentPort() |
protected int |
processPacket(byte[] bytes,
int pos) |
void |
run() |
protected static final org.slf4j.Logger logger
protected int maxPacketSize
protected final boolean debug
protected java.util.concurrent.ExecutorService executor
protected int currentPort
protected final TcpTransporter transporter
protected java.nio.channels.ServerSocketChannel serverChannel
protected java.nio.channels.Selector selector
public TcpReader(TcpTransporter transporter)
public void connect()
throws java.lang.Exception
java.lang.Exceptionpublic int getCurrentPort()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic void disconnect()
public void run()
run in interface java.lang.Runnableprotected int processPacket(byte[] bytes,
int pos)
throws java.lang.Exception
java.lang.Exceptionprotected void close(java.nio.channels.SelectionKey key,
java.lang.Exception cause)