Esempio n. 1
0
        private void OnPingTimerCallback(object state)
        {
            IProtocolProcessor protocolProcessor = state as IProtocolProcessor;

            if (!string.IsNullOrEmpty(m_LastPingRequest) && !m_LastPingRequest.Equals(LastPongResponse))
            {
                try
                {
                    protocolProcessor.SendPong(this, "");
                }
                catch (Exception e)
                {
                    OnError(e);
                    return;
                }
            }
            m_LastPingRequest = DateTime.Now.ToString();
            try
            {
                protocolProcessor.SendPing(this, m_LastPingRequest);
            }
            catch (Exception e2)
            {
                OnError(e2);
            }
        }
Esempio n. 2
0
        private void OnPingTimerCallback(object state)
        {
            if (!string.IsNullOrEmpty(this.m_LastPingRequest) && !this.m_LastPingRequest.Equals(this.LastPongResponse))
            {
                return;
            }
            IProtocolProcessor protocolProcessor = state as IProtocolProcessor;

            this.m_LastPingRequest = DateTime.Now.ToString();
            try {
                protocolProcessor.SendPing(this, this.m_LastPingRequest);
            } catch (Exception ex) {
                this.OnError(ex);
            }
        }