Class StreamEngine
java.lang.Object
zmq.io.StreamEngine
- All Implemented Interfaces:
IEngine, IPollEvents
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumprivate final classprivate static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IDecoderprivate IEncoderprivate final Stringprivate final Errnoprivate SocketChannelprivate final ByteBufferprivate final ByteBufferprivate intprivate Poller.Handleprivate static final intprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate static final intprivate static final intprivate static final intprivate final byte[]private final intprivate ByteBufferprivate booleanprivate intprivate booleanprivate IOObjectprivate Mechanismprivate Metadataprivate final Optionsprivate final ValueReference<ByteBuffer> private booleanprivate intprivate final Addressprivate booleanprivate SessionBaseprivate static final intprivate SocketBaseprivate booleanprivate static final intprivate static final intprivate StreamEngine.Protocol -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleandecodeAndPush(Msg msg) private booleanprivate voiddecodeDataAfterHandshake(int greetingSize) voiddestroy()private voiderror(StreamEngine.ErrorReason error) private booleanprivate intprivate MsgvoidinEvent()Called by I/O thread when file descriptor is ready for reading.private <T> Tinstantiate(Class<T> clazz, int size, long max) private voidprivate MsgvoidoutEvent()Called by I/O thread when file descriptor is ready for writing.voidplug(IOThread ioThread, SessionBase session) private booleanprocessCommand(Msg msg) private booleanprivate booleanprivate booleanprocessIdentityMsg(Msg msg) private Msgprivate MsgproducePongMessage(byte[] pingContext) private Msgprivate Msgprivate booleanpushMsgToSession(Msg msg) private booleanprivate booleanpushRawMsgToSession(Msg msg) private intread(ByteBuffer buf) voidvoidprivate voidvoidvoidtimerEvent(int id) Called when timer expires.toString()private voidunplug()private intwrite(ByteBuffer outbuf) private booleanwriteCredential(Msg msg) voidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IPollEvents
acceptEvent, connectEvent
-
Field Details
-
ioObject
-
fd
-
handle
-
inpos
-
insize
private int insize -
decoder
-
outpos
-
outsize
private int outsize -
encoder
-
metadata
-
handshaking
private boolean handshaking -
SIGNATURE_SIZE
private static final int SIGNATURE_SIZE- See Also:
-
V2_GREETING_SIZE
private static final int V2_GREETING_SIZE- See Also:
-
V3_GREETING_SIZE
private static final int V3_GREETING_SIZE- See Also:
-
greetingSize
private int greetingSize -
greetingRecv
-
greetingSend
-
zmtpVersion
-
session
-
options
-
endpoint
-
plugged
private boolean plugged -
nextMsg
-
processMsg
-
ioError
private boolean ioError -
subscriptionRequired
private boolean subscriptionRequired -
mechanism
-
inputStopped
private boolean inputStopped -
outputStopped
private boolean outputStopped -
HANDSHAKE_TIMER_ID
private static final int HANDSHAKE_TIMER_ID- See Also:
-
HEARTBEAT_TTL_TIMER_ID
private static final int HEARTBEAT_TTL_TIMER_ID- See Also:
-
HEARTBEAT_IVL_TIMER_ID
private static final int HEARTBEAT_IVL_TIMER_ID- See Also:
-
HEARTBEAT_TIMEOUT_TIMER_ID
private static final int HEARTBEAT_TIMEOUT_TIMER_ID- See Also:
-
hasHandshakeTimer
private boolean hasHandshakeTimer -
hasTtlTimer
private boolean hasTtlTimer -
hasTimeoutTimer
private boolean hasTimeoutTimer -
hasHeartbeatTimer
private boolean hasHeartbeatTimer -
heartbeatTimeout
private final int heartbeatTimeout -
heartbeatContext
private final byte[] heartbeatContext -
socket
-
peerAddress
-
errno
-
processIdentity
-
nextIdentity
-
processHandshakeCommand
-
nextHandshakeCommand
-
pushMsgToSession
-
pullMsgFromSession
-
pushRawMsgToSession
-
writeCredential
-
pullAndEncode
-
decodeAndPush
-
pushOneThenDecodeAndPush
-
producePingMessage
-
-
Constructor Details
-
StreamEngine
-
-
Method Details
-
heartbeatTimeout
private int heartbeatTimeout() -
destroy
public void destroy() -
plug
-
instantiate
-
unplug
private void unplug() -
terminate
-
inEvent
public void inEvent()Description copied from interface:IPollEventsCalled by I/O thread when file descriptor is ready for reading.- Specified by:
inEventin interfaceIPollEvents
-
outEvent
public void outEvent()Description copied from interface:IPollEventsCalled by I/O thread when file descriptor is ready for writing.- Specified by:
outEventin interfaceIPollEvents
-
restartOutput
public void restartOutput()- Specified by:
restartOutputin interfaceIEngine
-
restartInput
public void restartInput()- Specified by:
restartInputin interfaceIEngine
-
decodeCurrentInputs
private boolean decodeCurrentInputs() -
handshake
private boolean handshake() -
decodeDataAfterHandshake
private void decodeDataAfterHandshake(int greetingSize) -
identityMsg
-
processIdentityMsg
-
nextHandshakeCommand
-
processHandshakeCommand
-
zapMsgAvailable
public void zapMsgAvailable()- Specified by:
zapMsgAvailablein interfaceIEngine
-
mechanismReady
private void mechanismReady() -
pullMsgFromSession
-
pushMsgToSession
-
pushRawMsgToSession
-
writeCredential
-
pullAndEncode
-
decodeAndPush
-
pushOneThenDecodeAndPush
-
error
-
setHandshakeTimer
private void setHandshakeTimer() -
timerEvent
public void timerEvent(int id) Description copied from interface:IPollEventsCalled when timer expires.- Specified by:
timerEventin interfaceIPollEvents- Parameters:
id- the ID of the expired timer.
-
producePingMessage
-
producePongMessage
-
processCommand
-
processHeartbeatMessage
-
write
-
read
-
getEndPoint
- Specified by:
getEndPointin interfaceIEngine
-
toString
-