You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicstaticvoidmain(String[] args) {
Clientclient = null;
FilefilePath = newFile(args[0]);
Filefolder = newFile(args[1]);
try {
client = newClient(
// This is the interface the client will listen on (you might need something// else than localhost here).InetAddress.getLocalHost(),
// Load the torrent from the torrent file and use the given// output directory. Partials downloads are automatically recovered.SharedTorrent.fromFile(
filePath,
folder));
} catch (IOException | NoSuchAlgorithmExceptione1) {
e1.printStackTrace();
}
client.share();
client.waitForCompletion();
Tracker Program
publicstaticvoidmain(String[] args) throwsIOException, NoSuchAlgorithmException {
// First, instantiate a Tracker object with the port you want it to listen on.// The default tracker port recommended by the BitTorrent protocol is 6969.Trackertracker = newTracker(newInetSocketAddress(6969));
// Then, for each torrent you wish to announce on this tracker, simply created// a TrackedTorrent object and pass it to the tracker.announce() method:FilenameFilterfilter = newFilenameFilter() {
@Overridepublicbooleanaccept(Filedir, Stringname) {
returnname.endsWith(".torrent");
}
};
for (Filef : newFile(args[0]).listFiles(filter)) {
tracker.announce(TrackedTorrent.load(f));
}
// Once done, you just have to start the tracker's main operation loop:tracker.start();
}
When i run these Programs, Client Program output the log "Tracker message violates expected protocol(Could not decode tracker message(not B-encoded?)!)"
Why are these Programs don't work?Is this an issue?
The text was updated successfully, but these errors were encountered:
Are you sure the Torrent file you are serving with this tracker actually points at the tracker you are running, and not some other tracker on the internet? You can use ttorrent-torrent to display information about the torrent file and show what tracker it points to.
Client Program
Tracker Program
When i run these Programs, Client Program output the log "Tracker message violates expected protocol(Could not decode tracker message(not B-encoded?)!)"
Why are these Programs don't work?Is this an issue?
The text was updated successfully, but these errors were encountered: