Package zmq.io.net.tcp
Class TcpConnecter
java.lang.Object
zmq.ZObject
zmq.Own
zmq.io.net.tcp.TcpConnecter
- All Implemented Interfaces:
IPollEvents
- Direct Known Subclasses:
IpcConnecter
,SocksConnecter
,TipcConnecter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Address
private int
protected final boolean
private SocketChannel
private Poller.Handle
protected final IOObject
protected static final int
private final SessionBase
private final SocketBase
private boolean
-
Constructor Summary
ConstructorsConstructorDescriptionTcpConnecter
(IOThread ioThread, SessionBase session, Options options, Address addr, boolean delayedStart) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
protected void
close()
private SocketChannel
connect()
void
Called by I/O thread when file descriptor might be ready for connecting.protected void
destroy()
private int
void
inEvent()
Called by I/O thread when file descriptor is ready for reading.private boolean
open()
void
outEvent()
Called by I/O thread when file descriptor is ready for writing.protected void
protected void
processTerm
(int linger) private void
void
timerEvent
(int id) Called when timer expires.toString()
Methods inherited from class zmq.Own
incSeqnum, isTerminating, launchChild, processDestroy, processOwn, processSeqnum, processTermAck, processTermReq, termChild, terminate
Methods inherited from class zmq.ZObject
chooseIoThread, connectPending, destroySocket, findEndpoint, getCtx, getTid, pendConnection, processActivateRead, processActivateWrite, processAttach, processBind, processHiccup, processPipeTerm, processPipeTermAck, processReap, processReaped, processStop, registerEndpoint, sendActivateRead, sendActivateWrite, sendAttach, sendAttach, sendBind, sendBind, sendDone, sendHiccup, sendInprocConnected, sendOwn, sendPipeTerm, sendPipeTermAck, sendPlug, sendPlug, sendReap, 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
-
Field Details
-
RECONNECT_TIMER_ID
protected static final int RECONNECT_TIMER_ID- See Also:
-
ioObject
-
addr
-
fd
-
handle
-
delayedStart
protected final boolean delayedStart -
timerStarted
private boolean timerStarted -
session
-
currentReconnectIvl
private int currentReconnectIvl -
socket
-
-
Constructor Details
-
TcpConnecter
public TcpConnecter(IOThread ioThread, SessionBase session, Options options, Address addr, boolean delayedStart)
-
-
Method Details
-
destroy
protected void destroy() -
processPlug
protected void processPlug()- Overrides:
processPlug
in classZObject
-
processTerm
protected void processTerm(int linger) - Overrides:
processTerm
in classOwn
-
connectEvent
public void connectEvent()Description copied from interface:IPollEvents
Called by I/O thread when file descriptor might be ready for connecting.- Specified by:
connectEvent
in interfaceIPollEvents
-
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.
-
startConnecting
private void startConnecting() -
addReconnectTimer
private void addReconnectTimer() -
getNewReconnectIvl
private int getNewReconnectIvl() -
open
- Throws:
IOException
-
connect
-
close
protected void close() -
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
-
toString
-