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, terminatechooseIoThread, 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, unregisterEndpointsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacceptEventprotected 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 ZObjectprotected void processTerm(int linger)
processTerm in class Ownpublic void connectEvent()
IPollEventsconnectEvent in interface IPollEventspublic void timerEvent(int id)
IPollEventstimerEvent in interface IPollEventsid - the ID of the expired timer.private void startConnecting()
private void addReconnectTimer()
private int getNewReconnectIvl()
private boolean open()
throws java.io.IOException
java.io.IOExceptionprivate java.nio.channels.SocketChannel connect()
protected void close()
public void inEvent()
IPollEventsinEvent in interface IPollEventspublic void outEvent()
IPollEventsoutEvent in interface IPollEventspublic java.lang.String toString()
toString in class java.lang.Object