示例#1
0
        private static byte[] Encode(TorrentInfo torrentInfo, int interval, int minInterval)
        {
            var response = new Dictionary<string, object>
            {
                ["complete"] = torrentInfo.GetCompletedPeersCount(),
                ["incomplete"] = torrentInfo.GetIncompletedPeersCount(),
                ["interval"] = interval,
                ["min interval"] = minInterval,
                ["peers"] = GetPeersAsBytesArray(torrentInfo.Peers)
            };

            return BencodeUtility.Encode(response).ToArray();
        }