public void Ping(uint ms, byte[] payload = null, pnCallback cb = null) { pnCli2Auth_PingRequest req = new pnCli2Auth_PingRequest(); req.fPayload = payload; req.fPingTimeMs = ms; req.fTransID = GetTransID(); lock (fStream) { if (cb != null) fCallbacks.Add(req.fTransID, cb); req.Send(fStream); } }
private void IPingPong() { pnCli2Auth_PingRequest req = new pnCli2Auth_PingRequest(); req.Read(fStream); pnAuth2Cli_PingReply reply = new pnAuth2Cli_PingReply(); reply.fPayload = req.fPayload; reply.fPingTimeMs = req.fPingTimeMs; reply.fTransID = req.fTransID; reply.Send(fStream); }