aldenml/libtorrent4j

Alert not known

reeve567 opened this issue · 10 comments

Using the DownloadTorrent demo, I'm getting this as an error

Exception in thread "SessionManager-alertsLoop" java.lang.IllegalArgumentException: alert not known: 3 - test.txt added
	at org.libtorrent4j.alerts.Alerts.handleUnknownAlert(Alerts.java:628)
	at org.libtorrent4j.alerts.Alerts.access$000(Alerts.java:19)
	at org.libtorrent4j.alerts.Alerts$4.cast(Alerts.java:56)
	at org.libtorrent4j.alerts.Alerts.cast(Alerts.java:29)
	at org.libtorrent4j.SessionManager$5.run(SessionManager.java:1206)

Not sure if it's useful, but I was only able to get the Unsatisfied Link error to go away after adding the dll to my java path via execution arguments.
Using "org.libtorrent4j:libtorrent4j:2.0.5-22" on gradle, and (attempted) to add "org.libtorrent4j:libtorrent4j-windows:2.0.5-22" as well.
Happened both with an actual torrent file and one I just made to test. Both torrents only included one file, the previous a zip, this one "test.txt" as seen above.

Thanks for reporting, I will look at it.

Hi @reeve567 , I looked at this, and the message 3 - test.txt added indicates that internally I'm receiving a torrent_added_alert, but that alert is deprecated from a long time ago and I compile without deprecated features. Can you provide more details on how are you getting the DLL and the output at the beginning? You should get this message:

Using libtorrent version: 2.0.5.0

Got the same version, and I got the DLL from the latest jar on maven central (https://search.maven.org/remotecontent?filepath=org/libtorrent4j/libtorrent4j-windows/2.0.5-22/libtorrent4j-windows-2.0.5-22.jar), just extracted it and took the DLL and added it to the java path at launch

I was originally using an older version of libtorrent, but that was before I figured out the java path

https://gist.github.com/3762c927c7eb031d99e2e95f0759d246 <- Code

Using libtorrent version: 2.0.5.0
Torrent added
Exception in thread "SessionManager-alertsLoop" java.lang.IllegalArgumentException: alert not known: 3 - test added
	at org.libtorrent4j.alerts.Alerts.handleUnknownAlert(Alerts.java:628)
	at org.libtorrent4j.alerts.Alerts.access$000(Alerts.java:19)
	at org.libtorrent4j.alerts.Alerts$4.cast(Alerts.java:56)
	at org.libtorrent4j.alerts.Alerts.cast(Alerts.java:29)
	at org.libtorrent4j.SessionManager$5.run(SessionManager.java:1206)
	at java.base/java.lang.Thread.run(Thread.java:832)

what about the message at the beginning? (while running the demo)

I tend to edit everything after I post so that's there now, sorry.

Here's all the other versions included in the LibTorrent class

Using libtorrent version: 2.0.5.0
Other: 1_74
Other: 2.0.5-22
Other: OpenSSL 1.1.1m  14 Dec 2021
System.out.println("Using libtorrent version: " + LibTorrent.version());
System.out.println("Other: " + LibTorrent.boostVersion());
System.out.println("Other: " + LibTorrent.libtorrent4jVersion());
System.out.println("Other: " + LibTorrent.opensslVersion());

very strange, I will keep searching

@reeve567 I think I found it, I will make a new release soon

Hi @reeve567 2.0.5-23 is out, give it a try and let me know

Will try shortly :)

Works wonders, thank you :)