CompactPeer() private method

private CompactPeer ( ) : byte[]
return byte[]
示例#1
0
 public void CompactPeerTest()
 {
     string peerId = "12345abcde12345abcde";
     Uri uri = new Uri("tcp://192.168.0.5:12345");
     Peer p = new Peer(peerId, uri);
     byte[] compact = p.CompactPeer();
     Peer peer = Peer.Decode((BEncoding.BEncodedString)compact)[0];
     Assert.AreEqual(p.ConnectionUri, peer.ConnectionUri);
 }
示例#2
0
        public void CompactPeer()
        {
            const string peerId = "12345abcde12345abcde";

            var uri = new Uri("tcp://192.168.0.5:12345");
            var p = new Peer(peerId, uri);

            var compact = p.CompactPeer();
            var peer = Peer.Decode(compact)[0];

            Assert.AreEqual(p.ConnectionUri, peer.ConnectionUri, "#1");
        }