Package zmq.io
Class StreamEngine
java.lang.Object
zmq.io.StreamEngine
- All Implemented Interfaces:
IEngine
,IPollEvents
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
private final class
private static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IDecoder
private IEncoder
private final String
private final Errno
private SocketChannel
private final ByteBuffer
private final ByteBuffer
private int
private Poller.Handle
private static final int
private boolean
private boolean
private boolean
private boolean
private boolean
private static final int
private static final int
private static final int
private final byte[]
private final int
private ByteBuffer
private boolean
private int
private boolean
private IOObject
private Mechanism
private Metadata
private final Options
private final ValueReference
<ByteBuffer> private boolean
private int
private final Address
private boolean
private SessionBase
private static final int
private SocketBase
private boolean
private static final int
private static final int
private StreamEngine.Protocol
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
decodeAndPush
(Msg msg) private boolean
private void
decodeDataAfterHandshake
(int greetingSize) void
destroy()
private void
error
(StreamEngine.ErrorReason error) private boolean
private int
private Msg
void
inEvent()
Called by I/O thread when file descriptor is ready for reading.private <T> T
instantiate
(Class<T> clazz, int size, long max) private void
private Msg
void
outEvent()
Called by I/O thread when file descriptor is ready for writing.void
plug
(IOThread ioThread, SessionBase session) private boolean
processCommand
(Msg msg) private boolean
private boolean
private boolean
processIdentityMsg
(Msg msg) private Msg
private Msg
producePongMessage
(byte[] pingContext) private Msg
private Msg
private boolean
pushMsgToSession
(Msg msg) private boolean
private boolean
pushRawMsgToSession
(Msg msg) private int
read
(ByteBuffer buf) void
void
private void
void
void
timerEvent
(int id) Called when timer expires.toString()
private void
unplug()
private int
write
(ByteBuffer outbuf) private boolean
writeCredential
(Msg msg) void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface zmq.poll.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
public void terminate() -
inEvent
public void inEvent()Description copied from interface:IPollEvents
Called by I/O thread when file descriptor is ready for reading.- Specified by:
inEvent
in interfaceIPollEvents
-
outEvent
public void outEvent()Description copied from interface:IPollEvents
Called by I/O thread when file descriptor is ready for writing.- Specified by:
outEvent
in interfaceIPollEvents
-
restartOutput
public void restartOutput()- Specified by:
restartOutput
in interfaceIEngine
-
restartInput
public void restartInput()- Specified by:
restartInput
in 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:
zapMsgAvailable
in 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:IPollEvents
Called when timer expires.- Specified by:
timerEvent
in interfaceIPollEvents
- Parameters:
id
- the ID of the expired timer.
-
producePingMessage
-
producePongMessage
-
processCommand
-
processHeartbeatMessage
-
write
-
read
-
getEndPoint
- Specified by:
getEndPoint
in interfaceIEngine
-
toString
-