예제 #1
0
        private void LoadSupports(BEncodedDictionary supports)
        {
            ExtensionSupports list = new ExtensionSupports();

            foreach (KeyValuePair <BEncodedString, BEncodedValue> k in supports)
            {
                list.Add(new ExtensionSupport(k.Key.Text, (byte)((BEncodedNumber)k.Value).Number));
            }

            this.supports = list;
        }
        public ExtendedHandshakeMessage(bool privateTorrent, int metadataSize)
            : base(Support.MessageId)
        {
            supports = new ExtensionSupports(ExtensionMessage.SupportedMessages);
            if (privateTorrent)
            {
                supports.Remove(PeerExchangeMessage.Support);
            }

            this.metadataSize = metadataSize;
        }
예제 #3
0
        public ExtendedHandshakeMessage(bool privateTorrent, int metadataSize, int localListenPort)
            : base(Support.MessageId)
        {
            Supports = new ExtensionSupports(SupportedMessages);
            if (privateTorrent)
            {
                Supports.Remove(PeerExchangeMessage.Support);
            }

            MetadataSize = metadataSize;
            LocalPort    = localListenPort;
        }
예제 #4
0
 public ExtendedHandshakeMessage()
     : base(Support.MessageId)
 {
     supports = new ExtensionSupports();
 }