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