示例#1
0
 private static void loadDefaultConfig() {
   Config.getConfig().load();
   Config.getConfig().setDefault("peer-max", 500);
   Config.getConfig().setDefault("peer-max_burst_ratio", 1.5F);
   Config.getConfig().setDefault("peer-max_concurrent_connecting", 2);
   Config.getConfig().setDefault("peer-max_connecting", 50);
   Config.getConfig().setDefault("download-output_folder", ".\\");
   Config.getConfig().setDefault("download-port", 6881);
   Config.getConfig().setDefault("general-show_all_peers", false);
 }
示例#2
0
 private UdpMultiplexer() {
   super("UdpMultiplexer");
   utpSockets = new BinarySearchTree<>();
   packetFactory = new UtpPacketFactory();
   try {
     multiplexerSocket = new DatagramSocket(Config.getConfig().getInt("download-port"));
     new UtpSocketTimeout().start();
     start();
   } catch (IOException e) {
     e.printStackTrace();
   }
 }