public class TcpConnecter extends Own implements IPollEvents
Modifier and Type | Field and Description |
---|---|
private Address |
addr |
private int |
currentReconnectIvl |
protected boolean |
delayedStart |
private java.nio.channels.SocketChannel |
fd |
private Poller.Handle |
handle |
protected IOObject |
ioObject |
protected static int |
RECONNECT_TIMER_ID |
private SessionBase |
session |
private SocketBase |
socket |
private boolean |
timerStarted |
Constructor and Description |
---|
TcpConnecter(IOThread ioThread,
SessionBase session,
Options options,
Address addr,
boolean delayedStart) |
Modifier and Type | Method and Description |
---|---|
private void |
addReconnectTimer() |
protected void |
close() |
private java.nio.channels.SocketChannel |
connect() |
void |
connectEvent()
Called by I/O thread when file descriptor might be ready for connecting.
|
protected void |
destroy() |
private int |
getNewReconnectIvl() |
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 |
processPlug() |
protected void |
processTerm(int linger) |
private void |
startConnecting() |
void |
timerEvent(int id)
Called when timer expires.
|
java.lang.String |
toString() |
incSeqnum, isTerminating, launchChild, processDestroy, processOwn, processSeqnum, processTermAck, processTermReq, termChild, terminate
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, unregisterEndpoints
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
acceptEvent
protected static final int RECONNECT_TIMER_ID
protected final IOObject ioObject
private final Address addr
private java.nio.channels.SocketChannel fd
private Poller.Handle handle
protected final boolean delayedStart
private boolean timerStarted
private final SessionBase session
private int currentReconnectIvl
private final SocketBase socket
public TcpConnecter(IOThread ioThread, SessionBase session, Options options, Address addr, boolean delayedStart)
protected void processPlug()
processPlug
in class ZObject
protected void processTerm(int linger)
processTerm
in class Own
public void connectEvent()
IPollEvents
connectEvent
in interface IPollEvents
public void timerEvent(int id)
IPollEvents
timerEvent
in interface IPollEvents
id
- the ID of the expired timer.private void startConnecting()
private void addReconnectTimer()
private int getNewReconnectIvl()
private boolean open() throws java.io.IOException
java.io.IOException
private java.nio.channels.SocketChannel connect()
protected void close()
public void inEvent()
IPollEvents
inEvent
in interface IPollEvents
public void outEvent()
IPollEvents
outEvent
in interface IPollEvents
public java.lang.String toString()
toString
in class java.lang.Object