frostwire / frostwire-jlibtorrent

A swig Java interface for libtorrent by the makers of FrostWire. Develop libtorrent based apps with the joy of coding in Java.
http://www.frostwire.com
MIT License
451 stars 138 forks source link

[1.2.0.9] Nev behaviour of AnnounceEntry #169

Closed proninyaroslav closed 7 years ago

proninyaroslav commented 7 years ago

Hello. Prior to version 1.2.0.9, I used the following code to determine tracker status:

if (entry.swig().getVerified() && entry.swig().is_working()) {
    return Status.WORKING;
} else if ((entry.swig().getFails() == 0) && entry.swig().getUpdating()) {
    return Status.UPDATING;
} else if (entry.swig().getFails() == 0) {
    return Status.NOT_CONTACTED;
} else {
    return Status.NOT_WORKING;
}

but now these methods are removed from the libtorrent. Is there a similar way to get tracker status?

aldenml commented 7 years ago

Well, there is no way at this moment. When the refactor was done in libtorrent (related to the multi-home support) I didn't expose the new API via SWIG. I think I can do that in short time, I will let you know. Thanks for reporting this.

proninyaroslav commented 7 years ago

Very operational work, thank you! I'll test this feature right after lib appears in maven.

aldenml commented 7 years ago

@proninyaroslav 1.2.0.10 is ready in maven.

Remember that now libtorrent is multi-home. You need to take the announce_entry and ask for the vector of announce_endpoints, then ask for the fields you were looking.