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 Addressprivate intprotected final booleanprivate SocketChannelprivate Poller.Handleprotected final IOObjectprotected static final intprivate final SessionBaseprivate final SocketBaseprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionTcpConnecter(IOThread ioThread, SessionBase session, Options options, Address addr, boolean delayedStart) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprotected voidclose()private SocketChannelconnect()voidCalled by I/O thread when file descriptor might be ready for connecting.protected voiddestroy()private intvoidinEvent()Called by I/O thread when file descriptor is ready for reading.private booleanopen()voidoutEvent()Called by I/O thread when file descriptor is ready for writing.protected voidprotected voidprocessTerm(int linger) private voidvoidtimerEvent(int id) Called when timer expires.toString()Methods inherited from class Own
incSeqnum, isTerminating, launchChild, processDestroy, processOwn, processSeqnum, processTermAck, processTermReq, termChild, terminateMethods inherited from class ZObject
chooseIoThread, connectPending, destroySocket, findEndpoint, getCtx, getTid, pendConnection, processActivateRead, processActivateWrite, processAttach, 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, unregisterEndpointsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface 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
-
processPlug
protected void processPlug()- Overrides:
processPlugin classZObject
-
processTerm
protected void processTerm(int linger) - Overrides:
processTermin classOwn
-
connectEvent
public void connectEvent()Description copied from interface:IPollEventsCalled by I/O thread when file descriptor might be ready for connecting.- Specified by:
connectEventin interfaceIPollEvents
-
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.
-
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: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
-
toString
-