public override void StreamDataReceived(BoltConnection connection, UdpStreamData data) { string localHash = CreateHash(data.Data); BoltLog.Info("Received data from channel {0}: {1} bytes [{2}] [{3}]", data.Channel, data.Data.Length, localHash, connection); var evt = DataStreamCheck.Create(connection, ReliabilityModes.ReliableOrdered); evt.hash = localHash; evt.Send(); }
public override void OnEvent(DataStreamCheck evnt) { if (evnt.hash.Equals(hash)) { BoltLog.Info("Other end received data: it's EQUAL"); } else { BoltLog.Error("Other end received data: it's NOT EQUAL"); } canSend = true; }
public override void OnEvent(DataStreamCheck evnt) { if (evnt.hash.Equals(hash)) { var diff = Time.time - timestamp; timestamp = 0; BoltLog.Info("Other end received data: it's EQUAL in {0}secs", diff); } else { BoltLog.Error("Other end received data: it's NOT EQUAL"); } canSend = true; }