Changeset 1249
- Timestamp:
- Oct 22, 2010, 8:13:17 AM (13 years ago)
- Location:
- extensions/net.sf.basedb.torrent/trunk/src/external/hpbtc/hpbtc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.torrent/trunk/src/external/hpbtc/hpbtc/protocol/processor/Client.java
r1248 r1249 34 34 private byte[] protocol; 35 35 36 public Client(byte[] peerId) throws UnsupportedEncodingException{36 public Client(byte[] peerId) { 37 37 fastTimer = new Timer(true); 38 38 torrents = new Vector<Torrent>(); … … 41 41 } 42 42 43 public Client() throws UnsupportedEncodingException{43 public Client() { 44 44 this(TorrentUtil.generateId()); 45 45 } -
extensions/net.sf.basedb.torrent/trunk/src/external/hpbtc/hpbtc/util/TorrentUtil.java
r1248 r1249 85 85 } 86 86 87 public static byte[] generateId() throws UnsupportedEncodingException{87 public static byte[] generateId() { 88 88 byte[] pid = new byte[20]; 89 89 ByteBuffer bb = ByteBuffer.wrap(pid); 90 bb.put("CristianMocanu".getBytes("US-ASCII")); 90 try { 91 bb.put("CristianMocanu".getBytes("US-ASCII")); 92 } 93 catch (UnsupportedEncodingException ex) 94 {} // Should never happen 91 95 Random r = new Random(); 92 96 for (int i = 14; i < 20; i++) { … … 96 100 } 97 101 98 public static byte[] getSupportedProtocol() throws 99 UnsupportedEncodingException { 102 public static byte[] getSupportedProtocol() { 100 103 byte[] protocol = new byte[20]; 101 104 ByteBuffer pr = ByteBuffer.wrap(protocol); 102 105 pr.put((byte) 19); 103 pr.put("BitTorrent protocol".getBytes("US-ASCII")); 106 try { 107 pr.put("BitTorrent protocol".getBytes("US-ASCII")); 108 } 109 catch (UnsupportedEncodingException ex) 110 {} // Should never happen 104 111 return protocol; 105 112 } -
extensions/net.sf.basedb.torrent/trunk/src/external/hpbtc/hpbtc/util/TrackerUtil.java
r1248 r1249 19 19 20 20 public static Set<Peer> doCompactPeer(final byte[] prs) 21 throws Un supportedEncodingException, UnknownHostException {21 throws UnknownHostException { 22 22 final Set<Peer> peers = new HashSet<Peer>(); 23 23 int k = 0;
Note: See TracChangeset
for help on using the changeset viewer.