private void SendHeartBeat(object source, ElapsedEventArgs e)
        {
            var span = DateTime.Now - _lastTime;

            _timeout = (int)span.TotalMilliseconds;
            if (_timeout > _interval * 2)
            {
                SkynetLogger.Info(Channel.NetDevice, "timeout disconnect");
                _client.Disconnect();
            }
            else
            {
                _client.Request("heartbeat", (SpObject obj) => { ResetTimeout(); });
            }
        }
Exemple #2
0
 private void Disconnect()
 {
     _client.Disconnect();
 }