Package zmq.io
Class SessionBase
- java.lang.Object
-
- zmq.ZObject
-
- zmq.Own
-
- zmq.io.SessionBase
-
- All Implemented Interfaces:
Pipe.IPipeEvents,IPollEvents
- Direct Known Subclasses:
Dish.DishSession,HelloMsgSession,Radio.RadioSession,Req.ReqSession
public class SessionBase extends Own implements Pipe.IPipeEvents, IPollEvents
-
-
Field Summary
Fields Modifier and Type Field Description private booleanactiveprivate Addressaddrprivate IEngineengineprivate booleanhasLingerTimerprivate booleanincompleteInprivate IOObjectioObjectprivate IOThreadioThreadprivate static intLINGER_TIMER_IDprivate booleanpendingprivate Pipepipeprotected SocketBasesocketprivate java.util.Set<Pipe>terminatingPipesprivate PipezapPipe
-
Constructor Summary
Constructors Constructor Description SessionBase(IOThread ioThread, boolean connect, SocketBase socket, Options options, Address addr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattachPipe(Pipe pipe)private voidcleanPipes()voiddestroy()voidengineError(boolean handshaked, StreamEngine.ErrorReason reason)voidflush()java.lang.StringgetEndpoint()SocketBasegetSocket()voidhiccuped(Pipe pipe)voidincSeqnum()voidpipeTerminated(Pipe pipe)protected voidprocessAttach(IEngine engine)protected voidprocessPlug()protected voidprocessTerm(int linger)protected MsgpullMsg()protected booleanpushMsg(Msg msg)voidreadActivated(Pipe pipe)MsgreadZapMsg()private voidreconnect()protected voidreset()private voidstartConnecting(boolean wait)voidtimerEvent(int id)Called when timer expires.java.lang.StringtoString()voidwriteActivated(Pipe pipe)booleanwriteZapMsg(Msg msg)intzapConnect()protected booleanzapEnabled()-
Methods inherited from class zmq.Own
isTerminating, launchChild, processDestroy, processOwn, processSeqnum, processTermAck, processTermReq, termChild, terminate
-
Methods inherited from class zmq.ZObject
chooseIoThread, connectPending, destroySocket, findEndpoint, getCtx, getTid, pendConnection, processActivateRead, processActivateWrite, processBind, processCancel, processHiccup, processPipeTerm, processPipeTermAck, processReap, processReapAck, processReaped, processStop, registerEndpoint, sendActivateRead, sendActivateWrite, sendAttach, sendAttach, sendBind, sendBind, sendCancel, sendDone, sendHiccup, sendInprocConnected, sendOwn, sendPipeTerm, sendPipeTermAck, sendPlug, sendPlug, sendReap, sendReapAck, sendReaped, sendStop, sendTerm, sendTermAck, sendTermReq, setTid, unregisterEndpoint, unregisterEndpoints
-
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, inEvent, outEvent
-
-
-
-
Field Detail
-
active
private final boolean active
-
pipe
private Pipe pipe
-
zapPipe
private Pipe zapPipe
-
terminatingPipes
private final java.util.Set<Pipe> terminatingPipes
-
incompleteIn
private boolean incompleteIn
-
pending
private boolean pending
-
engine
private IEngine engine
-
socket
protected final SocketBase socket
-
ioThread
private final IOThread ioThread
-
LINGER_TIMER_ID
private static final int LINGER_TIMER_ID
- See Also:
- Constant Field Values
-
hasLingerTimer
private boolean hasLingerTimer
-
addr
private final Address addr
-
ioObject
private final IOObject ioObject
-
-
Constructor Detail
-
SessionBase
public SessionBase(IOThread ioThread, boolean connect, SocketBase socket, Options options, Address addr)
-
-
Method Detail
-
attachPipe
public void attachPipe(Pipe pipe)
-
pullMsg
protected Msg pullMsg()
-
pushMsg
protected boolean pushMsg(Msg msg)
-
readZapMsg
public Msg readZapMsg()
-
writeZapMsg
public boolean writeZapMsg(Msg msg)
-
reset
protected void reset()
-
flush
public void flush()
-
cleanPipes
private void cleanPipes()
-
pipeTerminated
public void pipeTerminated(Pipe pipe)
- Specified by:
pipeTerminatedin interfacePipe.IPipeEvents
-
readActivated
public void readActivated(Pipe pipe)
- Specified by:
readActivatedin interfacePipe.IPipeEvents
-
writeActivated
public void writeActivated(Pipe pipe)
- Specified by:
writeActivatedin interfacePipe.IPipeEvents
-
hiccuped
public void hiccuped(Pipe pipe)
- Specified by:
hiccupedin interfacePipe.IPipeEvents
-
getSocket
public SocketBase getSocket()
-
processPlug
protected void processPlug()
- Overrides:
processPlugin classZObject
-
zapConnect
public int zapConnect()
-
zapEnabled
protected boolean zapEnabled()
-
processAttach
protected void processAttach(IEngine engine)
- Overrides:
processAttachin classZObject
-
engineError
public void engineError(boolean handshaked, StreamEngine.ErrorReason reason)
-
processTerm
protected void processTerm(int linger)
- Overrides:
processTermin classOwn
-
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.
-
reconnect
private void reconnect()
-
startConnecting
private void startConnecting(boolean wait)
-
getEndpoint
public java.lang.String getEndpoint()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-