public PongMessage(byte[] data) : base(UdpMessageType.DISCOVER_PONG, data) { try { this.message = Protocol.PongMessage.Parser.ParseFrom(data); } catch (System.Exception e) { Logger.Error(e.Message); } }
public PongMessage(Node from, long sequence) : base(UdpMessageType.DISCOVER_PONG, null) { Protocol.Endpoint endpoint_from = new Protocol.Endpoint(); endpoint_from.NodeId = ByteString.CopyFrom(from.Id); endpoint_from.Port = from.Port; endpoint_from.Address = ByteString.CopyFrom(Encoding.UTF8.GetBytes(from.Host)); this.message = new Protocol.PongMessage(); this.message.From = endpoint_from; this.message.Echo = (int)Args.Instance.Node.P2P.Version; this.message.Timestamp = sequence; this.data = this.message.ToByteArray(); }