Beispiel #1
0
 public void Ping()
 {
     try
     {
         UInt32 diff = Time.LastCheckTime - m_LastTime;
         if (Time.LastCheckTime - m_LastTime > 40000)
         {
             Logger.Log(Logger.LogLevel.Warning, "Client Timeout", "Socket : {0}", ((IPEndPoint)Client.Socket.RemoteEndPoint).Address.ToString());
             this.Disconnect();
         }
         else
         {
             SMSG_PING spkt = new SMSG_PING(m_PingCount, Time.LastCheckTime);
             this.Client.Socket.Send(spkt.Stream);
             ++m_PingCount;
         }
     }
     catch (SocketException se)
     {
         Logger.Log(Logger.LogLevel.Warning, "Client", "Socket : {0}", se.Message);
     }
 }