我从这里下载了ubuntu 17.10的torrent文件: https://www.ubuntu.com/download/alternative-downloads
这里面是什么:
public class VendingMachineChangeCalculator {
public static void main(String[] args) {
Scanner takeit = new Scanner(System.in);
System.out.println("Enter a whole number from 1 to 99"
+ "\nI will find a combination of coins that equals"
+"the amount of change ");
int money = 0;
System.out.println("Please enter number: ");
money = takeit.nextInt();
if(money>0 && money<=99) {
System.out.println("You have: ");
int quarter, dime, nickel, penny;
quarter = money/25;
money = money %25;
dime = money/10;
money = money %10;
nickel = money/5;
money = money%5;
penny = money;
System.out.println(quarter + " quarters");
System.out.println(dime + " dimes");
System.out.println(nickel + " nickles");
System.out.println(penny + " pennies");
System.out.print("Good job, enter a new valid integer: ");
money = takeit.nextInt();
}
else {System.out.print("Invalid entry, please try again: ");
money = takeit.nextInt();
}
takeit.close();
}
}
我尝试过:
我已发送:(仅限torrent-hash)
并收到:
你给我发了垃圾 - 不是长度为20
我发送了:( torrent torrent-hash和我的peer-id)
并收到:
你给我发了垃圾 - 用基数为10的long()文字无效:&#39;&#39;
规格:
https://wiki.theory.org/index.php/BitTorrentSpecification#Tracker_HTTP.2FHTTPS_Protocol
答案 0 :(得分:4)
宣布错过强制性密钥端口,已上传,已下载和已离开。
这些键加上 info_hash 和 peer_id ,必须在每个宣布中。
此外,虽然每个宣布中都不强制使用事件键,但 第一个宣布到跟踪器必须包含' event = started '。
尝试:
并且跟踪器回复:
您的客户已过时,请升级
哦,还有更多要修复......
从我的答案:Why does tracker server NOT understand my request? (Bittorrent protocol)
这是因为请求字符串中没有 compact = 1 现在大多数跟踪器需要。传统方式效率太低。
所以,将 compact = 1 添加到宣布:
并且跟踪器回复:
d8:completei2134e10:incompletei100e8:intervali1800e5:peers300:[二进制数据...] e
成功!