public class StreamEngine extends java.lang.Object implements IEngine, IPollEvents, IMsgSink
| Modifier and Type | Field and Description |
|---|---|
private DecoderBase |
decoder |
private EncoderBase |
encoder |
private java.lang.String |
endpoint |
private java.nio.ByteBuffer |
greeting |
private static int |
GREETING_SIZE |
private java.nio.ByteBuffer |
greetingOutputBuffer |
private java.nio.channels.SocketChannel |
handle |
private boolean |
handshaking |
private java.nio.ByteBuffer |
inbuf |
private int |
insize |
private boolean |
ioEnabled |
private IOObject |
ioObject |
private Options |
options |
private Transfer |
outbuf |
private int |
outsize |
private boolean |
plugged |
private SessionBase |
session |
private SocketBase |
socket |
| Constructor and Description |
|---|
StreamEngine(java.nio.channels.SocketChannel handle,
Options options,
java.lang.String endpoint) |
| Modifier and Type | Method and Description |
|---|---|
void |
acceptEvent() |
void |
activateIn() |
void |
activateOut() |
void |
connectEvent() |
void |
destroy() |
private void |
error() |
private boolean |
handshake() |
void |
inEvent() |
private DecoderBase |
newDecoder(int size,
long max,
SessionBase session,
int version) |
private EncoderBase |
newEncoder(int size,
SessionBase session,
int version) |
void |
outEvent() |
void |
plug(IOThread ioThread,
SessionBase session) |
int |
pushMsg(Msg msg) |
private int |
read(java.nio.ByteBuffer buf) |
void |
terminate() |
void |
timerEvent(int id) |
private void |
unplug() |
private int |
write(Transfer buf) |
private static final int GREETING_SIZE
private boolean ioEnabled
private java.nio.channels.SocketChannel handle
private java.nio.ByteBuffer inbuf
private int insize
private DecoderBase decoder
private Transfer outbuf
private int outsize
private EncoderBase encoder
private boolean handshaking
private final java.nio.ByteBuffer greeting
private final java.nio.ByteBuffer greetingOutputBuffer
private SessionBase session
private Options options
private java.lang.String endpoint
private boolean plugged
private SocketBase socket
private IOObject ioObject
public StreamEngine(java.nio.channels.SocketChannel handle,
Options options,
java.lang.String endpoint)
private DecoderBase newDecoder(int size, long max, SessionBase session, int version)
private EncoderBase newEncoder(int size, SessionBase session, int version)
public void destroy()
public void plug(IOThread ioThread, SessionBase session)
private void unplug()
public void inEvent()
inEvent in interface IPollEventspublic void outEvent()
outEvent in interface IPollEventspublic void connectEvent()
connectEvent in interface IPollEventspublic void acceptEvent()
acceptEvent in interface IPollEventspublic void timerEvent(int id)
timerEvent in interface IPollEventspublic void activateOut()
activateOut in interface IEnginepublic void activateIn()
activateIn in interface IEngineprivate boolean handshake()
private void error()
private int write(Transfer buf)
private int read(java.nio.ByteBuffer buf)