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 overridden to define
what to do when a connection appears to be dead.
Thread.State, Thread.UncaughtExceptionHandler
MAX_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()
Deprecated.
as of 2.9
Override
onDead(Throwable) to receive the cause, but also override this method
and provide a fallback behaviour to be backward compatible with earlier version of remoting library. |
protected void |
onDead(Throwable diagnosis)
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, yield
public PingThread(Channel channel, long timeout, long interval)
public PingThread(Channel channel, long interval)
public PingThread(Channel channel)
@Deprecated protected abstract void onDead()
onDead(Throwable)
to receive the cause, but also override this method
and provide a fallback behaviour to be backward compatible with earlier version of remoting library.protected void onDead(Throwable diagnosis)
Copyright © 2004–2022. All rights reserved.