public uint Ping(uint pingTime, byte[] payload) { Gate_PingPong ping = new Gate_PingPong(); ping.fPayload = payload; ping.fPingTime = pingTime; ping.fTransID = IGetTransID(); ResetIdleTimer(); lock (fStream) { fStream.BufferWriter(); fStream.WriteUShort((ushort)GateCli2Srv.PingRequest); ping.Write(fStream); fStream.FlushWriter(); } return ping.fTransID; }
private void IPong() { Gate_PingPong pong = new Gate_PingPong(); pong.Read(fStream); if (Pong != null) Pong(pong.fTransID, pong.fPingTime, pong.fPayload); }