|
|
@ -45,11 +45,11 @@ func WithHeartbeatWS(interval time.Duration, hbdFn WsHeartbeatFn) nnet.RunOption
|
|
|
|
break
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
deadline := time.Now().Add(-2 * m.interval).Unix()
|
|
|
|
//deadline := time.Now().Add(-2 * m.interval).Unix()
|
|
|
|
if atomic.LoadInt64(&m.lastAt) < deadline {
|
|
|
|
//if atomic.LoadInt64(&m.lastAt) < deadline {
|
|
|
|
nlog.Errorf("Heartbeat timeout, LastTime=%d, Deadline=%d", atomic.LoadInt64(&m.lastAt), deadline)
|
|
|
|
// nlog.Errorf("Heartbeat timeout, LastTime=%d, Deadline=%d", atomic.LoadInt64(&m.lastAt), deadline)
|
|
|
|
break
|
|
|
|
// break
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
err := m.hbdFn(nc.WsConn())
|
|
|
|
err := m.hbdFn(nc.WsConn())
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|