net.sf.jqql.obsolete
Class HeartBeatThread
java.lang.Object
java.lang.Thread
net.sf.jqql.obsolete.HeartBeatThread
- All Implemented Interfaces:
- Runnable
public class HeartBeatThread
- extends Thread
Heart beat thread, beat per 3 second, checkout current status when beat, if there is packet need to resend, then resend
if add up 30 beat there isn't any reply, stop transfer as network error. if other side has reply, just not reply heart * beat, stop current handle after 15 beat, til opp opposite reply heart beat, and continue other handle.
Heart beat 线程,æ¯3秒一跳,跳时检查当å‰çжæ€ï¼Œè‹¥æœ‰éœ€è¦é‡å‘的包,则é‡å‘
如果累计30è·³éƒ½æ²¡æœ‰ä»»ä½•å›žåº”ï¼Œå½“ä½œç½‘ç»œé”™è¯¯åœæ¢ä¼ è¾“ã€‚å¦‚æžœå…¶ä»–æ–¹é¢æœ‰å›žåº”,但是
就是ä¸å›žåº”heart beat,在15跳之åŽåœæ¢å½“剿“作,直到对方回应heart beatåŽæ‰
ç»§ç»å…¶ä»–çš„æ“作
- Author:
- luma
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, 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 |
HeartBeatThread
public HeartBeatThread(FileSender sender)
- constructed function
æž„é€ å‡½æ•°
- Parameters:
sender
-
run
public void run()
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread
setStop
public void setStop(boolean stop)
- Parameters:
stop
- The stop to set.
setMaxReply
public void setMaxReply(char maxReply)
- Parameters:
maxReply
- The maxReply to set.
setAnybodyLiving
public void setAnybodyLiving(boolean anybodyLiving)
- Parameters:
anybodyLiving
- The anybodyLiving to set.