Search in sources :

Example 1 with CachePeer

use of com.biglybt.core.peer.cache.CachePeer in project BiglyBT by BiglySoftware.

the class CLCacheDiscovery method main.

public static void main(String[] args) {
    try {
        TOTorrent torrent = TOTorrentFactory.deserialiseFromBEncodedFile(new File("C:\\temp\\test.torrent"));
        CachePeer[] peers = new CLCacheDiscovery().lookup(torrent);
        System.out.println("peers=" + peers.length);
        for (int i = 0; i < peers.length; i++) {
            System.out.println("    cache: " + peers[i].getAddress() + ":" + peers[i].getPort());
        }
    } catch (Throwable e) {
        e.printStackTrace();
    }
}
Also used : CachePeer(com.biglybt.core.peer.cache.CachePeer) TOTorrent(com.biglybt.core.torrent.TOTorrent) File(java.io.File)

Aggregations

CachePeer (com.biglybt.core.peer.cache.CachePeer)1 TOTorrent (com.biglybt.core.torrent.TOTorrent)1 File (java.io.File)1