|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
NetLogClient.LogConnectionMgr
This inner class is designed to maintain the socket connection from the NetLogClient to the NetLogServer. The class will test the connection every so-many seconds, and if the connection is broken, it will attempt to reconnect it, waiting so-many seconds between attempts.
| Field Summary | |
static int |
CHECK_WAIT_TIME
This is the amount of time (in seconds) to wait between checks. |
private byte[] |
nop
The string to write as the 'no operation' operation command. |
static int |
RECONNECT_WAIT_TIME
This is the amount of time (in seconds) to wait between reconnection attempts. |
private OutputStream |
testOut
Our output stream for testing the connection. |
private boolean |
wasConnected
Used to keep track of whether or not the client was connected. |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
NetLogClient.LogConnectionMgr()
Initialize the class by saving the OutputStream and figuring out the connections initial state. |
|
| Method Summary | |
void |
reconnect()
Loops forever trying to reconnect the socket. |
void |
run()
Run in an infinite loop testing the connection, reconnecting it when the connection fails. |
boolean |
testConnected()
Tests the connection to see if it is connected or not. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int CHECK_WAIT_TIME
public static final int RECONNECT_WAIT_TIME
private final byte[] nop
private boolean wasConnected
private OutputStream testOut
| Constructor Detail |
public NetLogClient.LogConnectionMgr()
| Method Detail |
public void run()
public boolean testConnected()
public void reconnect()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||