Package zmq.io

Class StreamEngine

    • Field Detail

      • fd

        private java.nio.channels.SocketChannel fd
      • inpos

        private java.nio.ByteBuffer inpos
      • insize

        private int insize
      • outsize

        private int outsize
      • handshaking

        private boolean handshaking
      • greetingSize

        private int greetingSize
      • greetingRecv

        private final java.nio.ByteBuffer greetingRecv
      • greetingSend

        private final java.nio.ByteBuffer greetingSend
      • options

        private final Options options
      • endpoint

        private final java.lang.String endpoint
      • plugged

        private boolean plugged
      • processMsg

        private Function<Msg,​java.lang.Boolean> processMsg
      • ioError

        private boolean ioError
      • subscriptionRequired

        private boolean subscriptionRequired
      • inputStopped

        private boolean inputStopped
      • outputStopped

        private boolean outputStopped
      • HEARTBEAT_TTL_TIMER_ID

        private static final int HEARTBEAT_TTL_TIMER_ID
        See Also:
        Constant Field Values
      • HEARTBEAT_IVL_TIMER_ID

        private static final int HEARTBEAT_IVL_TIMER_ID
        See Also:
        Constant Field Values
      • HEARTBEAT_TIMEOUT_TIMER_ID

        private static final int HEARTBEAT_TIMEOUT_TIMER_ID
        See Also:
        Constant Field Values
      • 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
      • peerAddress

        private final Address peerAddress
      • errno

        private final Errno errno
      • processIdentity

        private final Function<Msg,​java.lang.Boolean> processIdentity
      • nextIdentity

        private final Supplier<Msg> nextIdentity
      • processHandshakeCommand

        private final Function<Msg,​java.lang.Boolean> processHandshakeCommand
      • nextHandshakeCommand

        private final Supplier<Msg> nextHandshakeCommand
      • pushMsgToSession

        private final Function<Msg,​java.lang.Boolean> pushMsgToSession
      • pullMsgFromSession

        private final Supplier<Msg> pullMsgFromSession
      • pushRawMsgToSession

        private final Function<Msg,​java.lang.Boolean> pushRawMsgToSession
      • writeCredential

        private final Function<Msg,​java.lang.Boolean> writeCredential
      • pullAndEncode

        private final Supplier<Msg> pullAndEncode
      • decodeAndPush

        private final Function<Msg,​java.lang.Boolean> decodeAndPush
      • pushOneThenDecodeAndPush

        private final Function<Msg,​java.lang.Boolean> pushOneThenDecodeAndPush
      • producePingMessage

        private final Supplier<Msg> producePingMessage
    • Constructor Detail

      • StreamEngine

        public StreamEngine​(java.nio.channels.SocketChannel fd,
                            Options options,
                            java.lang.String endpoint)
    • Method Detail

      • heartbeatTimeout

        private int heartbeatTimeout()
      • destroy

        public void destroy()
      • instantiate

        private <T> T instantiate​(java.lang.Class<T> clazz,
                                  int size,
                                  long max)
      • unplug

        private void unplug()
      • terminate

        public void terminate()
        Specified by:
        terminate in interface IEngine
      • 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 interface IPollEvents
      • 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 interface IPollEvents
      • decodeCurrentInputs

        private boolean decodeCurrentInputs()
      • handshake

        private boolean handshake()
      • decodeDataAfterHandshake

        private void decodeDataAfterHandshake​(int greetingSize)
      • identityMsg

        private Msg identityMsg()
      • processIdentityMsg

        private boolean processIdentityMsg​(Msg msg)
      • nextHandshakeCommand

        private Msg nextHandshakeCommand()
      • processHandshakeCommand

        private boolean processHandshakeCommand​(Msg msg)
      • mechanismReady

        private void mechanismReady()
      • pullMsgFromSession

        private Msg pullMsgFromSession()
      • pushMsgToSession

        private boolean pushMsgToSession​(Msg msg)
      • pushRawMsgToSession

        private boolean pushRawMsgToSession​(Msg msg)
      • writeCredential

        private boolean writeCredential​(Msg msg)
      • pullAndEncode

        private Msg pullAndEncode()
      • decodeAndPush

        private boolean decodeAndPush​(Msg msg)
      • pushOneThenDecodeAndPush

        private boolean pushOneThenDecodeAndPush​(Msg msg)
      • setHandshakeTimer

        private void setHandshakeTimer()
      • timerEvent

        public void timerEvent​(int id)
        Description copied from interface: IPollEvents
        Called when timer expires.
        Specified by:
        timerEvent in interface IPollEvents
        Parameters:
        id - the ID of the expired timer.
      • producePingMessage

        private Msg producePingMessage()
      • producePongMessage

        private Msg producePongMessage​(byte[] pingContext)
      • processCommand

        private boolean processCommand​(Msg msg)
      • processHeartbeatMessage

        private boolean processHeartbeatMessage​(Msg msg)
      • write

        private int write​(java.nio.ByteBuffer outbuf)
      • read

        private int read​(java.nio.ByteBuffer buf)
      • getEndPoint

        public java.lang.String getEndPoint()
        Specified by:
        getEndPoint in interface IEngine
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object