예제 #1
0
        public IPv6Node(NodeID nodeId, IPv6PeerContact contact)
        {
            ID      = nodeId;
            Contact = contact;

            CompactNodeInfo = new byte[CompactInfoSize];
            Array.Copy(ID.Bytes, 0, CompactNodeInfo, 0, NodeID.Size);
            Contact.Encode(((Span <byte>)CompactNodeInfo).Slice(NodeID.Size));
        }
예제 #2
0
 public static void Encode(Span <byte> bytes, NodeID nodeId, IPAddress ipAddress, int port)
 {
     nodeId.CopyTo(bytes);
     IPv6PeerContact.Encode(bytes.Slice(NodeID.Size), ipAddress, port);
 }