public abstract class PingThread extends Thread
Useful when a connection needs to be kept alive by sending data, or when the disconnection is not properly detected.
onDead() method needs to be overrided to define
what to do when a connection appears to be dead.
Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
PingThread(Channel channel) |
PingThread(Channel channel,
long interval) |
PingThread(Channel channel,
long timeout,
long interval) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
onDead()
Called when ping failed.
|
void |
run() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldCopyright © 2015. All Rights Reserved.