Git Product home page Git Product logo

frostwire-jlibtorrent's Introduction

frostwire-jlibtorrent

JLibtorrent Logo

A swig Java interface for libtorrent by the makers of FrostWire.

Develop libtorrent based apps with the joy of coding in Java.

Discord Developer Chatroom Invite

Using

Download the latest release .jars

All platforms will need you to use at least 2 .jar files.

The .jar with the java classes -> jlibtorrent-w.x.y.z.jar and a secondary .jars containing the JNI binary library for the particular OS and CPU architecture.

In the case of desktop operating systems, you might want to extract the shared library inside the jar (.dll, .so, .dylib) and place it in a folder specified by the java.library.path

The secondary jars are:

  • Windows: jlibtorrent-windows-w.x.y.z.jar (x86 and x86_64 .dlls)
  • Mac: jlibtorrent-macosx-w.x.y.z.jar (x86_64 .dylib)
  • Linux: jlibtorrent-linux-w.x.y.z.jar (x86 and x86_64 .so)

In the case of Android, make sure to put the following 5 jars in your project's libs folder (see FrostWire for Android's as an example):

  • jlibtorrent-w.x.y.z.jar
  • jlibtorrent-android-arm-w.x.y.z.jar
  • jlibtorrent-android-arm64-w.x.y.z.jar
  • jlibtorrent-android-x86-w.x.y.z.jar
  • jlibtorrent-android-x86_64-w.x.y.z.jar

If you use ProGuard to obfuscate/minify make sure to add the following statement

-keep class com.frostwire.jlibtorrent.swig.libtorrent_jni {*;}

Note that there are multiple version of jlibtorrent for different platforms: jlibtorrent, jlibtorrent-windows, jlibtorrent-linux, jlibtorrent-macosx and jlibtorrent-android-<arch>. These are all different artifacts.

For examples look at https://github.com/frostwire/frostwire-jlibtorrent/tree/master/src/test/java/com/frostwire/jlibtorrent/demo

Architectures supported:

  • Android (armeabi-v7a, arm64-v8a, x86, x86_64) sdk 24 (Android 7.0) and up
  • Linux (x86_64)
  • Windows (x86_64)
  • Mac OS X (x86_64)

Building

To build the macos (x86_64) binaries you will need a mac computer, to build the mac library issue the following command:

cd swig && ./build-macos.sh

To build the windows (x86_64), linux (x86_64) and android binaries (arm, arm64, x86, x86_64) you will need a working version of Docker, then just issue the following command

cd swig && ./docker_build_binaries.sh

The resulting jars will be at:

  • ./build/libs/jlibtorrent-w.x.y.z.jar
  • ./build/libs/jlibtorrent-windows-w.x.y.z.jar
  • ./build/libs/jlibtorrent-macos-w.x.y.z.jar
  • ./build/libs/jlibtorrent-linux-w.x.y.z.jar
  • ./build/libs/jlibtorrent-android-arm-w.x.y.z.jar
  • ./build/libs/jlibtorrent-android-arm64-w.x.y.z.jar
  • ./build/libs/jlibtorrent-android-x86-w.x.y.z.jar
  • ./build/libs/jlibtorrent-android-x86_64-w.x.y.z.jar

If you need the singled out .so,.dylib and .dll files and their .debug versions they will be at:

  • ./swig/bin/release/windows/x86_64/jlibtorrent.dll
  • ./swig/bin/release/macosx/x86_64/libjlibtorrent.dylib
  • ./swig/bin/release/linux/x86_64/libjlibtorrent.so
  • ./swig/bin/release/android/armeabi-v7a/libjlibtorrent.so
  • ./swig/bin/release/android/arm64-v8a/libjlibtorrent.so
  • ./swig/bin/release/android/x86/libjlibtorrent.so
  • ./swig/bin/release/android/x86_64/libjlibtorrent.so

Projects using jLibtorrent

License

This software is offered under the MIT License, available here.

frostwire-jlibtorrent's People

Contributors

aldenml avatar benhc123 avatar burnbeforereading avatar dessalines avatar frostwire avatar gubatron avatar humzini avatar jbafford avatar masterwok avatar mrrory avatar proninyaroslav avatar tchoulihan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frostwire-jlibtorrent's Issues

Android libjlibtorrent.so cross-compile ARM build instructions

You guys rock!!!
I have jlibtorrent working wonderfully in my Android App.
And for that, I think you. (documentation was great)

I love the build scripts...so helpful.
I am attempting to build libjlibtorrent.so (libtorrent)
Step 1: get libtorrent sources
Step 2: set all environment variables
Step 3: run_swig.sh
Step 4: build_android.sh

Is this the correct order?

Getting missing file errors.
QUESTION: which libtorrent source version? 1.0.2, 1.0.4, latest?

Compiling on OSX Yosemite.

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jlibtorrent in java.library.path

Sorry for beeing a noob, but Im having issues getting "System.out.println("Using libtorrent version: " + LibTorrent.version());" run.

I have included everything in src so that all imports looks ok in Eclipse, but I have no idea how to do the build stuff, can I use the provided binaries or do I have to build something myself? It says "The result will be a libjlibtorrent.dylib", and thats provided in the rep. But how do I use it?

This is my code:

import java.io.File;
import java.util.concurrent.CountDownLatch;

import com.frostwire.jlibtorrent.LibTorrent;
import com.frostwire.jlibtorrent.Session;
import com.frostwire.jlibtorrent.TorrentAlertAdapter;
import com.frostwire.jlibtorrent.TorrentHandle;
import com.frostwire.jlibtorrent.alerts.BlockFinishedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentFinishedAlert;

public class Main {

    public static void main(String[] args) {
        System.out.println("Using libtorrent version: " + LibTorrent.version());
    }

}

And this is the complete error message:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jlibtorrent in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at com.frostwire.jlibtorrent.swig.libtorrent_jni.(libtorrent_jni.java:14)
at com.frostwire.jlibtorrent.swig.libtorrentConstants.(libtorrentConstants.java:12)
at com.frostwire.jlibtorrent.LibTorrent.version(LibTorrent.java:15)
at Main.main(Main.java:14)

Missing plugin interface

It appears that the plugin interface is not present in this version of jlibtorrent?

For the swig classes, the session does not have add_extension(), and the classes
plugin, torrent_plugin and peer_plugin are missing entirely.

This morning they were present, but the jlibtorrent_jni class did not implement all the required function calls to support the three classes.

Does jlibtorrent presently support the plugin interface, and what are the plans pertaining to this?

How to save a torrent file?

I can't for the life of me figure out how to save a torrent file with jlibtorrent.

I've looked at the two examples CreateTorrentTest, and CreateTorrentTest2.java, and they both seem to create com.frostwire.jlibtorrent.swig.entry, but I have no idea how to write this to an output stream.

I also see entry.bencode() [char_vector], but wouldn't know how to write a char_vector using java like this. Could you provide an example, using an outputstream or something?

file_storage fs = new file_storage();

        // Add the file
        libtorrent.add_files(fs, si.getFile().getAbsolutePath());

        create_torrent t = new create_torrent(fs);
        for (URI announce : DataSources.ANNOUNCE_LIST()) {
            log.info(announce.getPath());
            log.info(announce.getRawPath());
            t.add_tracker(announce.getPath());
        }

        t.set_creator(System.getProperty("user.name"));

        error_code ec = new error_code();


        // reads the files and calculates the hashes
        libtorrent.set_piece_hashes(t, si.getFile().getParent(), ec);

        if (ec.value() != 0) {
            log.info(ec.message());
        }

        entry e = t.generate();

Magnet-links

Magnet links are not working anymore, problem seems to be in: "torrent_handle th = s.getSwig().find_torrent(info_hash)" in Downloader.java

[CRASH] libtorrent::peer_connection::peer_connection(libtorrent::peer_connection_args const&)

Application version: 1.6.1
Android version: Android 5.0
Device: Galaxy Note4 (trltevzw)

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Verizon/trltevzw/trltevzw:5.0.1/LRX22C/N910VVRU2BOG5:user/release-keys'
Revision: '12'
ABI: 'arm'
pid: 6780, tid: 6796, name: ostwire.android >>> com.frostwire.android <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
r0 00000000 r1 00001a8c r2 00000006 r3 00000000
r4 b39c0db8 r5 00000006 r6 0000000c r7 0000010c
r8 a0fce960 r9 be6e8d8c sl a24a0d00 fp 00000001
ip 00001a8c sp b39c0860 lr b6ebaff5 pc b6ede264 cpsr 600f0010

backtrace:
#00 pc 00037264 /system/lib/libc.so (tgkill+12)
#01 pc 00013ff1 /system/lib/libc.so (pthread_kill+52)
#02 pc 00014c0f /system/lib/libc.so (raise+10)
#03 pc 00011531 /system/lib/libc.so (__libc_android_abort+36)
#04 pc 0000fcbc /system/lib/libc.so (abort+4)
#05 pc 0054fc0f /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (__gnu_cxx::__verbose_terminate_handler()+226)
#06 pc 005250a1 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (__cxxabiv1::__terminate(void (*)())+4)
#07 pc 00525115 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (std::terminate()+8)
#08 pc 0052526f /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (__cxa_rethrow+46)
#09 pc 00274e5d /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (libtorrent::peer_connection::peer_connection(libtorrent::peer_connection_args const&)+2112)
#10 pc 0041fac7 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (libtorrent::web_connection_base::web_connection_base(libtorrent::peer_connection_args const&, libtorrent::web_seed_t&)+10)
#11 pc 002b9abd /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (libtorrent::web_peer_connection::web_peer_connection(libtorrent::peer_connection_args const&, libtorrent::web_seed_t&)+12)
#12 pc 00357987 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (boost::detail::sp_if_not_array<libtorrent::web_peer_connection>::type boost::make_shared<libtorrent::web_peer_connection, boost::reference_wrapper<libtorrent::peer_connection_args const>, boost::reference_wrapper<libtorrent::web_seed_t> >(boost::reference_wrapper<libtorrent::peer_connection_args const> const&, boost::reference_wrapper<libtorrent::web_seed_t> const&)+66)
#13 pc 00338401 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (libtorrent::torrent::connect_web_seed(std::_List_iterator<libtorrent::web_seed_t>, boost::asio::ip::basic_endpoint<boost::asio::ip::tcp>)+2168)
#14 pc 00338f13 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (libtorrent::torrent::connect_to_url_seed(std::_List_iterator<libtorrent::web_seed_t>)+1482)
#15 pc 00339473 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (libtorrent::torrent::maybe_connect_web_seeds()+206)
#16 pc 002bddd7 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (boost::asio::detail::completion_handler<boost::_bi::bind_t<void, boost::_mfi::mf0<void, libtorrent::torrent>, boost::_bi::list1<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> > > > >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned int)+206)
#17 pc 002d6241 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (boost::asio::io_service::run()+648)
#18 pc 002834c9 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (boost_asio_detail_posix_thread_function+80)
#19 pc 000137bb /system/lib/libc.so (__pthread_start(void*)+30)
#20 pc 0001189b /system/lib/libc.so (__start_thread+6)

Strange QueuedThreadPool exception, UnknownError: Success

I occasionally get a strange exception when I run:

TorrentHandle torrent = session.addTorrent(torrentFile, outputParent);

What could be causing it?

21:04:35.293 [qtp790420105-37] WARN  o.e.j.util.thread.QueuedThreadPool - 
java.lang.UnknownError: Success
    at com.frostwire.jlibtorrent.swig.libtorrent_jni.new_torrent_info__SWIG_3(Native Method) ~[torrenttunes-server.jar:na]
    at com.frostwire.jlibtorrent.swig.torrent_info.<init>(torrent_info.java:51) ~[torrenttunes-server.jar:na]
    at com.frostwire.jlibtorrent.TorrentInfo.<init>(TorrentInfo.java:32) ~[torrenttunes-server.jar:na]
    at com.frostwire.jlibtorrent.Session.addTorrent(Session.java:160) ~[torrenttunes-server.jar:na]
    at com.frostwire.jlibtorrent.Session.addTorrent(Session.java:191) ~[torrenttunes-server.jar:na]
    at com.torrenttunes.client.LibtorrentEngine.addTorrent(LibtorrentEngine.java:182) ~[torrenttunes-server.jar:na]

where is the gradle script?

In the readme,

Building the frostwire-jlibtorrent.jar

inside the build/ folder just invoke gradle build

you will find the resulting frostwire-jlibtorrent.jar at build/build/libs/frostwire-jlibtorrent.jar.

But I could not find the gradle script.

Another crash

A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x00007f340c2eb0d0, pid=16604, tid=139861386065664

JRE version: Java(TM) SE Runtime Environment (7.0_80-b15) (build 1.7.0_80-b15)
Java VM: Java HotSpot(TM) 64-Bit Server VM (24.80-b11 mixed mode linux-amd64 compressed oops)
Problematic frame:
C 0x00007f340c2eb0d0

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.

--------------- T H R E A D ---------------

Current thread (0x00007f342420a800): JavaThread "pool-1-thread-14" [_thread_in_native, id=16662, stack(0x00007f34042bf000,0x00007f34043c0000)]

siginfo:si_signo=SIGSEGV: si_errno=0, si_code=2 (SEGV_ACCERR), si_addr=0x00007f340c2eb0d0

Registers:
RAX=0x00007f340d38c370, RBX=0x00007f340c3a3530, RCX=0x00007f34043be280, RDX=0x0000000000000084
RSP=0x00007f34043be248, RBP=0x00000000ffffffff, RSI=0x00007f34043be2a0, RDI=0x00007f340c3a3530
R8 =0x0000000000000001, R9 =0x0000000000000000, R10=0x00007f3420000078, R11=0x00007f3420000070
R12=0x00007f340d2e0bd0, R13=0x00007f340c3a3530, R14=0x00007f34043be2a0, R15=0x00007f34201c3118
RIP=0x00007f340c2eb0d0, EFLAGS=0x0000000000010246, CSGSFS=0x0000000000000033, ERR=0x0000000000000015
TRAPNO=0x000000000000000e

Top of Stack: (sp=0x00007f34043be248)
0x00007f34043be248: 00007f342e1b172e 00007f34201c3110
0x00007f34043be258: 00007f34201c3110 00007f34043be2e0
0x00007f34043be268: 00007f342e1d80dd ffff80cbfbc41d11
0x00007f34043be278: 00007f340c3a3530 0000000000000001
0x00007f34043be288: 0000000000000035 00007f340f0d1011
0x00007f34043be298: 0000000000000000 0000005b00000000
0x00007f34043be2a8: 0000000000000000 0000000000000000
0x00007f34043be2b8: 000000770000006e 0000000000000000
0x00007f34043be2c8: 00007f34043be2ef 00007f342420ba04
0x00007f34043be2d8: 00000000000003d8 62fad70e07d40d25
0x00007f34043be2e8: ef9db76800000000 0000000000000000
0x00007f34043be2f8: 00007f34043be2e8 00007f34043be2e8
0x00007f34043be308: 0000000000000000 00000000be230f04
0x00007f34043be318: 00007f3420000020 0000000000000101
0x00007f34043be328: 000000005696e27c 00000000bf021e01
0x00007f34043be338: 000000005696e27c 00007f342420a800
0x00007f34043be348: 1892458249c07800 00007f340d73b8c0
0x00007f34043be358: 00007f340d2e0bd0 00007f34201c3110
0x00007f34043be368: 00007f342420a9e8 00000000bf021e08
0x00007f34043be378: 00007f34043be448 00007f342420a800
0x00007f34043be388: 00007f342e193c8d 0000000000000000
0x00007f34043be398: 00000000bf021e08 00007f34043be418
0x00007f34043be3a8: 0000000000000000 00000000bf021e08
0x00007f34043be3b8: 00007f34450127f8 00007f34043be300
0x00007f34043be3c8: 0000000800000001 00007f340000000e
0x00007f34043be3d8: 00007f34043be3d8 0000000000000000
0x00007f34043be3e8: 00007f34043be448 00000000bf0447b8
0x00007f34043be3f8: 0000000000000000 00000000bf021e08
0x00007f34043be408: 0000000000000000 00007f34043be438
0x00007f34043be418: 00007f34043be498 00007f3445006175
0x00007f34043be428: 00000000c40b1690 00007f344500ecd7
0x00007f34043be438: 00000000eec97448 00007f340d2e0bd0

Instructions: (pc=0x00007f340c2eb0d0)
0x00007f340c2eb0b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00007f340c2eb0c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00007f340c2eb0d0: 00 00 00 00 00 00 00 00 35 00 00 00 00 00 00 00
0x00007f340c2eb0e0: 00 a8 09 0c 34 7f 00 00 e0 b0 2e 0c 34 7f 00 00

Register to memory mapping:

RAX=0x00007f340d38c370 is an unknown value
RBX=0x00007f340c3a3530 is an unknown value
RCX=0x00007f34043be280 is pointing into the stack for thread: 0x00007f342420a800
RDX=0x0000000000000084 is an unknown value
RSP=0x00007f34043be248 is pointing into the stack for thread: 0x00007f342420a800
RBP=0x00000000ffffffff is an unallocated location in the heap
RSI=0x00007f34043be2a0 is pointing into the stack for thread: 0x00007f342420a800
RDI=0x00007f340c3a3530 is an unknown value
R8 =0x0000000000000001 is an unknown value
R9 =0x0000000000000000 is an unknown value
R10=0x00007f3420000078 is an unknown value
R11=0x00007f3420000070 is an unknown value
R12=0x00007f340d2e0bd0 is an unknown value
R13=0x00007f340c3a3530 is an unknown value
R14=0x00007f34043be2a0 is pointing into the stack for thread: 0x00007f342420a800
R15=0x00007f34201c3118 is an unknown value

Stack: [0x00007f34042bf000,0x00007f34043c0000], sp=0x00007f34043be248, free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C 0x00007f340c2eb0d0

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.frostwire.jlibtorrent.swig.libtorrent_jni.new_create_torrent__SWIG_5(JLcom/frostwire/jlibtorrent/swig/torrent_info;)J+0
j com.frostwire.jlibtorrent.swig.create_torrent.(Lcom/frostwire/jlibtorrent/swig/torrent_info;)V+6
j com.frostwire.jlibtorrent.TorrentInfo.toEntry()Lcom/frostwire/jlibtorrent/Entry;+12
j com.frostwire.jlibtorrent.TorrentInfo.bencode()[B+1
j com.frostwire.jlibtorrent.Downloader.fetchMagnet(Ljava/lang/String;J)[B+318
j MagnetDownload.run()V+33
j java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+95
j java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub

OS: Ubuntu 14.04 64 bit
jlibtorrent-linux-1.1.0.19.jar

Any tips how to reduce the crashes? Should I test with Java 8?

[CRASH] libtorrent::web_connection_base::web_connection_base(libtorrent::peer_connection_args const&, libtorrent::web_seed_t&

Application version: 1.6.1
Android version: Android 5.0
Device: Galaxy Note4 (trltevzw)

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Verizon/trltevzw/trltevzw:5.0.1/LRX22C/N910VVRU2BOG5:user/release-keys'
Revision: '12'
ABI: 'arm'
pid: 22270, tid: 22321, name: ostwire.android >>> com.frostwire.android <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
r0 00000000 r1 00005731 r2 00000006 r3 00000000
r4 afadfdb8 r5 00000006 r6 0000000c r7 0000010c
r8 02cd9700 r9 ad4076d8 sl be6fb0ec fp 00000001
ip 00005731 sp afadf8f0 lr b6ebaff5 pc b6ede264 cpsr 600f0010

backtrace:
#00 pc 00037264 /system/lib/libc.so (tgkill+12)
#01 pc 00013ff1 /system/lib/libc.so (pthread_kill+52)
#02 pc 00014c0f /system/lib/libc.so (raise+10)
#03 pc 00011531 /system/lib/libc.so (__libc_android_abort+36)
#04 pc 0000fcbc /system/lib/libc.so (abort+4)
#05 pc 0054fc0f /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (__gnu_cxx::__verbose_terminate_handler()+226)
#06 pc 005250a1 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (__cxxabiv1::__terminate(void (*)())+4)
#07 pc 00525115 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (std::terminate()+8)
#08 pc 0052526f /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (__cxa_rethrow+46)
#09 pc 0042001f /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (libtorrent::web_connection_base::web_connection_base(libtorrent::peer_connection_args const&, libtorrent::web_seed_t&)+1378)
#10 pc 002b9abd /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (libtorrent::web_peer_connection::web_peer_connection(libtorrent::peer_connection_args const&, libtorrent::web_seed_t&)+12)
#11 pc 00357987 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (boost::detail::sp_if_not_array<libtorrent::web_peer_connection>::type boost::make_shared<libtorrent::web_peer_connection, boost::reference_wrapper<libtorrent::peer_connection_args const>, boost::reference_wrapper<libtorrent::web_seed_t> >(boost::reference_wrapper<libtorrent::peer_connection_args const> const&, boost::reference_wrapper<libtorrent::web_seed_t> const&)+66)
#12 pc 00338401 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (libtorrent::torrent::connect_web_seed(std::_List_iterator<libtorrent::web_seed_t>, boost::asio::ip::basic_endpoint<boost::asio::ip::tcp>)+2168)
#13 pc 00338f13 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (libtorrent::torrent::connect_to_url_seed(std::_List_iterator<libtorrent::web_seed_t>)+1482)
#14 pc 00339473 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (libtorrent::torrent::maybe_connect_web_seeds()+206)
#15 pc 002bddd7 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (boost::asio::detail::completion_handler<boost::_bi::bind_t<void, boost::_mfi::mf0<void, libtorrent::torrent>, boost::_bi::list1<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> > > > >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned int)+206)
#16 pc 002d6241 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (boost::asio::io_service::run()+648)
#17 pc 002834c9 /data/app/com.frostwire.android-1/lib/arm/libjlibtorrent.so (boost_asio_detail_posix_thread_function+80)
#18 pc 000137bb /system/lib/libc.so (__pthread_start(void*)+30)
#19 pc 0001189b /system/lib/libc.so (__start_thread+6)

invalid torrent handle used

java.lang.RuntimeException: invalid torrent handle used
at com.frostwire.jlibtorrent.swig.libtorrent_jni.session_handle_remove_torrent__SWIG_1(Native Method)
at com.frostwire.jlibtorrent.swig.session_handle.remove_torrent(session_handle.java:231)
at com.frostwire.jlibtorrent.Downloader.fetchMagnet(Downloader.java:150)

I sometimes see this exception.
Version: 1.1.0.19

arm64 for Android

Is there any chance you'll ever add arm64 library for Android to the maven distribution? I'm currently splitting my APK's by architecture to make sure it doesn't become huge (I use another native lib), but the arm64 version doesn't work without a arm64 library.

Architecture Binary Error

Hello Frostwire,
Exception in thread "main" java.lang.UnsatisfiedLinkError: Look for your architecture binary instructions at: https://github.com/frostwire/frostwire-jlibtorrent

I am getting this error, which i thought would have been a wrong version or OS , got the Jar from the releases tab on GitHub which i then decided to build it with gradle build nativWindowsJar (please correct me if i am wrong) after getting the exception, but am still getting the same error, I am running Windows 8, 64 Bit. Am i doing anything wrong here which would result in this error ?

Thank You For Your Help.

Torrent_finished alerts not firing

I've notice that occasionally, a torrent will be shown to be 100% downloaded, yet will not fire a torrent_finished alerts. It only happens sometimes.

Could you guys think of a possible cause of this? I've been stumped so far.

[Crash] signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 099bf868

Background:

This issue seems to happen quite frequently without any warning. I tried using the addr2line utility and came up with no possible leads. Hopefully this is helpful.

I'm using the gradle maven repo:

compile 'com.frostwire:jlibtorrent:1.1.0.0'
compile 'com.frostwire:jlibtorrent-android:1.1.0.0'

Let me know if you need anything else from me.

Stack Trace:

********** Crash dump: **********
Build fingerprint: 'G-Box/k200/k200:4.4.2/KOT49H/20150810:userdebug/dev-keys'
pid: 18003, tid: 18003, name: t.test.test  >>> net.test.test <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 099bf868
Stack frame     #00  pc 00281a8a  /data/app-lib/net.test.test-1/libjlibtorrent.so (boost::detail::shared_count::shared_count(boost::detail::weak_count const&, boost::detail::sp_nothrow_tag)+5)
Stack frame     #01  pc 00365b25  /data/app-lib/net.test.test-1/libjlibtorrent.so (libtorrent::torrent_handle::status(unsigned int) const+28)
Stack frame     #00  pc 00023bc4  /system/lib/libc.so (__futex_syscall3+8)
Stack frame     #01  pc 0000f564  /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
Stack frame     #02  pc 0000f5c4  /system/lib/libc.so (__pthread_cond_timedwait+64)
Stack frame     #03  pc 0007298b  /system/lib/libdvm.so
Stack frame     #04  pc 0005496d  /system/lib/libdvm.so
Stack frame     #05  pc 0000d200  /system/lib/libc.so (__thread_entry+72)
Stack frame     #06  pc 0000d398  /system/lib/libc.so (pthread_create+240)
Stack frame     #00  pc 00023388  /system/lib/libc.so (__rt_sigtimedwait+12)
Stack frame     #01  pc 00015569  /system/lib/libc.so (sigwait+24)
Stack frame     #02  pc 00051f53  /system/lib/libdvm.so
Stack frame     #03  pc 0005496d  /system/lib/libdvm.so
Stack frame     #04  pc 0000d200  /system/lib/libc.so (__thread_entry+72)
Stack frame     #05  pc 0000d398  /system/lib/libc.so (pthread_create+240)
Stack frame     #00  pc 000228ec  /system/lib/libc.so (select+16)
Stack frame     #01  pc 0006148f  /system/lib/libdvm.so
Stack frame     #02  pc 00063fe1  /system/lib/libdvm.so
Stack frame     #03  pc 0005496d  /system/lib/libdvm.so
Stack frame     #04  pc 0000d200  /system/lib/libc.so (__thread_entry+72)
Stack frame     #05  pc 0000d398  /system/lib/libc.so (pthread_create+240)
Stack frame     #00  pc 00023bc4  /system/lib/libc.so (__futex_syscall3+8)
Stack frame     #01  pc 0000f564  /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
Stack frame     #02  pc 0000f5c4  /system/lib/libc.so (__pthread_cond_timedwait+64)
Stack frame     #03  pc 00073f0f  /system/lib/libdvm.so
Stack frame     #04  pc 0005496d  /system/lib/libdvm.so
Stack frame     #05  pc 0000d200  /system/lib/libc.so (__thread_entry+72)
Stack frame     #06  pc 0000d398  /system/lib/libc.so (pthread_create+240)
Stack frame     #00  pc 00023bc4  /system/lib/libc.so (__futex_syscall3+8)
Stack frame     #01  pc 0000f564  /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
Stack frame     #02  pc 0000f5c4  /system/lib/libc.so (__pthread_cond_timedwait+64)
Stack frame     #03  pc 00052d73  /system/lib/libdvm.so
Stack frame     #04  pc 0006785d  /system/lib/libdvm.so
Stack frame     #05  pc 00026fe0  /system/lib/libdvm.so
Stack frame     #06  pc 0002dfa0  /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
Stack frame     #07  pc 0002b638  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
Stack frame     #08  pc 00060581  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
Stack frame     #09  pc 000605a5  /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
Stack frame     #10  pc 0005528b  /system/lib/libdvm.so
Stack frame     #11  pc 0000d200  /system/lib/libc.so (__thread_entry+72)
Stack frame     #12  pc 0000d398  /system/lib/libc.so (pthread_create+240)
Stack frame     #00  pc 00023bc4  /system/lib/libc.so (__futex_syscall3+8)
Stack frame     #01  pc 0000f564  /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
Stack frame     #02  pc 0000f5c4  /system/lib/libc.so (__pthread_cond_timedwait+64)
Stack frame     #03  pc 00052d73  /system/lib/libdvm.so
Stack frame     #04  pc 0006785d  /system/lib/libdvm.so
Stack frame     #05  pc 00026fe0  /system/lib/libdvm.so
Stack frame     #06  pc 0002dfa0  /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
Stack frame     #07  pc 0002b638  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
Stack frame     #08  pc 00060581  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
Stack frame     #09  pc 000605a5  /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
Stack frame     #10  pc 0005528b  /system/lib/libdvm.so
Stack frame     #11  pc 0000d200  /system/lib/libc.so (__thread_entry+72)
Stack frame     #12  pc 0000d398  /system/lib/libc.so (pthread_create+240)
Stack frame     #00  pc 00023bc4  /system/lib/libc.so (__futex_syscall3+8)
Stack frame     #01  pc 0000f564  /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
Stack frame     #02  pc 0000f5c4  /system/lib/libc.so (__pthread_cond_timedwait+64)
Stack frame     #03  pc 00052d73  /system/lib/libdvm.so
Stack frame     #04  pc 0006785d  /system/lib/libdvm.so
Stack frame     #05  pc 00026fe0  /system/lib/libdvm.so
Stack frame     #06  pc 0002dfa0  /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
Stack frame     #07  pc 0002b638  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
Stack frame     #08  pc 00060581  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
Stack frame     #09  pc 000605a5  /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
Stack frame     #10  pc 0005528b  /system/lib/libdvm.so
Stack frame     #11  pc 0000d200  /system/lib/libc.so (__thread_entry+72)
Stack frame     #12  pc 0000d398  /system/lib/libc.so (pthread_create+240)
Stack frame     #00  pc 000227a0  /system/lib/libc.so (__ioctl+8)
Stack frame     #01  pc 0002e807  /system/lib/libc.so (ioctl+14)
Stack frame     #02  pc 0001d3ed  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+140)
Stack frame     #03  pc 0001daf7  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+6)
Stack frame     #04  pc 0001db8d  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+48)
Stack frame     #05  pc 000219a5  /system/lib/libbinder.so
Stack frame     #06  pc 0000ea5d  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+216)
Stack frame     #07  pc 0004d5b9  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+68)
Stack frame     #08  pc 0000e58f  /system/lib/libutils.so
Stack frame     #09  pc 0000d200  /system/lib/libc.so (__thread_entry+72)
Stack frame     #10  pc 0000d398  /system/lib/libc.so (pthread_create+240)
Stack frame     #00  pc 000227a0  /system/lib/libc.so (__ioctl+8)
Stack frame     #01  pc 0002e807  /system/lib/libc.so (ioctl+14)
Stack frame     #02  pc 0001d3ed  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+140)
Stack frame     #03  pc 0001daf7  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+6)
Stack frame     #04  pc 0001db8d  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+48)
Stack frame     #05  pc 000219a5  /system/lib/libbinder.so
Stack frame     #06  pc 0000ea5d  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+216)
Stack frame     #07  pc 0004d5b9  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+68)
Stack frame     #08  pc 0000e58f  /system/lib/libutils.so
Stack frame     #09  pc 0000d200  /system/lib/libc.so (__thread_entry+72)
Stack frame     #10  pc 0000d398  /system/lib/libc.so (pthread_create+240)
Stack frame     #00  pc 00023954  /system/lib/libc.so (epoll_wait+12)
Stack frame     #01  pc 0025d749  /data/app-lib/net.test.test-1/libjlibtorrent.so (boost::asio::detail::epoll_reactor::run(bool, boost::asio::detail::op_queue<boost::asio::detail::task_io_service_operation>&)+36)
Stack frame     #00  pc 00023bc4  /system/lib/libc.so (__futex_syscall3+8)
Stack frame     #01  pc 0000f564  /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
Stack frame     #02  pc 0000f5c4  /system/lib/libc.so (__pthread_cond_timedwait+64)
Stack frame     #03  pc 003ac925  /data/app-lib/net.test.test-1/libjlibtorrent.so (libtorrent::disk_io_thread::thread_fun(int, libtorrent::disk_io_thread::thread_type_t, boost::shared_ptr<boost::asio::io_service::work>)+208)
Stack frame     #00  pc 00023bc4  /system/lib/libc.so (__futex_syscall3+8)
Stack frame     #01  pc 0000f564  /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
Stack frame     #02  pc 0000f5c4  /system/lib/libc.so (__pthread_cond_timedwait+64)
Stack frame     #03  pc 003ac925  /data/app-lib/net.test.test-1/libjlibtorrent.so (libtorrent::disk_io_thread::thread_fun(int, libtorrent::disk_io_thread::thread_type_t, boost::shared_ptr<boost::asio::io_service::work>)+208)
Stack frame     #00  pc 00023bc4  /system/lib/libc.so (__futex_syscall3+8)
Stack frame     #01  pc 0000f564  /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
Stack frame     #02  pc 0000f5c4  /system/lib/libc.so (__pthread_cond_timedwait+64)
Stack frame     #03  pc 003ac925  /data/app-lib/net.test.test-1/libjlibtorrent.so (libtorrent::disk_io_thread::thread_fun(int, libtorrent::disk_io_thread::thread_type_t, boost::shared_ptr<boost::asio::io_service::work>)+208)
Stack frame     #00  pc 00023bc4  /system/lib/libc.so (__futex_syscall3+8)
Stack frame     #01  pc 0000f564  /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
Stack frame     #02  pc 0000f5c4  /system/lib/libc.so (__pthread_cond_timedwait+64)
Stack frame     #03  pc 003ac9c1  /data/app-lib/net.test.test-1/libjlibtorrent.so (libtorrent::disk_io_thread::thread_fun(int, libtorrent::disk_io_thread::thread_type_t, boost::shared_ptr<boost::asio::io_service::work>)+364)
Stack frame     #00  pc 00023bc4  /system/lib/libc.so (__futex_syscall3+8)
Stack frame     #01  pc 0000f564  /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
Stack frame     #02  pc 0000f5c4  /system/lib/libc.so (__pthread_cond_timedwait+64)
Stack frame     #03  pc 003b7a97  /data/app-lib/net.test.test-1/libjlibtorrent.so (libtorrent::condition_variable::wait_for(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&, boost::chrono::duration<long long, boost::ratio<1ll, 1000000000ll> >)+138)
Stack frame     #04  pc 003f1a37  /data/app-lib/net.test.test-1/libjlibtorrent.so (libtorrent::alert_manager::wait_for_alert(boost::chrono::duration<long long, boost::ratio<1ll, 1000000000ll> >)+66)
Stack frame     #00  pc 00023bc4  /system/lib/libc.so (__futex_syscall3+8)
Stack frame     #01  pc 0000f564  /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
Stack frame     #02  pc 0000f5c4  /system/lib/libc.so (__pthread_cond_timedwait+64)
Stack frame     #03  pc 0025db7b  /data/app-lib/net.test.test-1/libjlibtorrent.so (boost::asio::detail::task_io_service::run(boost::system::error_code&)+562)
Stack frame     #00  pc 000227a0  /system/lib/libc.so (__ioctl+8)
Stack frame     #01  pc 0002e807  /system/lib/libc.so (ioctl+14)
Stack frame     #02  pc 00069f14  /system/lib/egl/libGLES_mali.so
Stack frame     #03  pc 0006a3d0  /system/lib/egl/libGLES_mali.so
Stack frame     #04  pc 0000d200  /system/lib/libc.so (__thread_entry+72)
Stack frame     #05  pc 0000d398  /system/lib/libc.so (pthread_create+240)
Stack frame     #00  pc 00023bc4  /system/lib/libc.so (__futex_syscall3+8)
Stack frame     #01  pc 0000f564  /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
Stack frame     #02  pc 00025894  /system/lib/libc.so
Stack frame     #03  pc 0000d200  /system/lib/libc.so (__thread_entry+72)
Stack frame     #04  pc 0000d398  /system/lib/libc.so (pthread_create+240)
Stack frame     #00  pc 00023bc4  /system/lib/libc.so (__futex_syscall3+8)
Stack frame     #01  pc 0000f564  /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
Stack frame     #02  pc 0000f5c4  /system/lib/libc.so (__pthread_cond_timedwait+64)
Stack frame     #03  pc 000698b4  /system/lib/egl/libGLES_mali.so
Stack frame     #04  pc 00064c28  /system/lib/egl/libGLES_mali.so
Stack frame     #05  pc 0000d200  /system/lib/libc.so (__thread_entry+72)
Stack frame     #06  pc 0000d398  /system/lib/libc.so (pthread_create+240)

Addr2Line:

Address: 00281a8a
_ZN4Swig17DirectorExceptionC2EP7JNIEnv_P11_jthrowable
??:?

Address: 00365b25
_ZN10libtorrent14session_handle14wait_for_alertEN5boost6chrono8durationIxNS1_5ratioILx1ELx1000000000EEEEE
??:?

Linux 32 bit issue... messages about stack_guard?

Hey guys, someone running my client is getting the following error:

Java HotSpot(TM) Server VM warning: You have loaded library /home/troll/.torrenttunes-client/src/lib/x86_64/libjlibtorrent.so which might have disabled stack guard. The VM will try to fix the stack guard now.
ย ย ย ย It's highly recommended that you fix the library with 'execstack -c ', or link it with '-z noexecstack'.
ย ย ย ย Exception in thread "main" java.lang.UnsatisfiedLinkError: Look for your architecture binary instructions at:ย ย ย ย https://github.com/frostwire/frostwire-jlibtorrent

Here's their full output, with java versions and uname:

ย ย ย ย troll@troll ~ ls -l ~/.torrenttunes-client/src/lib/x86_64/libjlibtorrent.so
ย ย ย ย -rw-r--r-- 1 troll troll 6323080 Eyl 14 20:00 /home/troll/.torrenttunes-client/src/lib/x86_64/libjlibtorrent.so

ย ย ย ย troll@troll ~/Desktop java -version 
ย ย ย ย java version "1.8.0_60"
ย ย ย ย Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
ย ย ย ย Java HotSpot(TM) Server VM (build 25.60-b23, mixed mode)

ย ย ย ย troll@troll ~ uname -aย ย ย ย 
ย ย ย ย Linux troll 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:31:42 UTC 2014 i686 i686 i686 GNU/Linux

ย ย ย ย troll@troll ~/Desktop java -jar torrenttunes-launcher.jar
ย ย ย ย 20:21:23.030 [main] INFO ROOT - Copying launcher jar to /home/troll/.torrenttunes-client/torrenttunes-launcher.jar ...
ย ย ย ย 20:21:23.068 [main] INFO ROOT - This jar: /home/troll/Desktop/torrenttunes-launcher.jar Launcher Jar: /home/troll/.torrenttunes-client/torrenttunes-launcher.jar
ย ย ย ย 20:21:23.126 [main] INFO com.torrenttunes.launcher.Updater - Checking for update...
ย ย ย ย 20:21:29.589 [main] INFO com.torrenttunes.launcher.Updater - Current Tag #: 0.5.0
ย ย ย ย 20:21:29.590 [main] INFO com.torrenttunes.launcher.Updater - Latest Tag #: 0.5.0
ย ย ย ย 20:21:29.591 [main] INFO com.torrenttunes.launcher.Updater - No updates found
ย ย ย ย 20:21:33.394 [main] INFO com.torrenttunes.client.tools.Tools - Home directory already exists
ย ย ย ย 20:21:33.487 [main] INFO com.torrenttunes.client.tools.Tools - The source directory already exists
ย ย ย ย 20:21:33.496 [main] INFO com.torrenttunes.client.tools.Tools - tools.js = /home/troll/.torrenttunes-client/src/web/js/tools.js
ย ย ย ย 20:21:33.639 [main] INFO c.t.client.db.InitializeTables - Using database located at : /home/troll/.torrenttunes-client/db/db.sqlite
ย ย ย ย 20:21:33.661 [main] INFO c.t.client.db.InitializeTables - DB already exists
ย ย ย ย 20:21:35.393 [main] INFO com.torrenttunes.client.db.Actions - Storage path = /home/troll/.torrenttunes-client/music
ย ย ย ย 20:21:35.395 [main] INFO com.torrenttunes.client.db.Actions - Applying libtorrent Settings...
ย ย ย ย 20:21:35.401 [main] INFO c.t.client.tools.DataSources - Operating system linux
ย ย ย ย 20:21:35.403 [main] INFO c.t.client.tools.DataSources - Using libtorrent @ /home/troll/.torrenttunes-client/src/lib/x86_64/libjlibtorrent.so
ย ย ย ย Java HotSpot(TM) Server VM warning: You have loaded library /home/troll/.torrenttunes-client/src/lib/x86_64/libjlibtorrent.so which might have disabled stack guard. The VM will try to fix the stack guard now.
ย ย ย ย It's highly recommended that you fix the library with 'execstack -c ', or link it with '-z noexecstack'.
ย ย ย ย Exception in thread "main" java.lang.UnsatisfiedLinkError: Look for your architecture binary instructions at:ย ย ย ย https://github.com/frostwire/frostwire-jlibtorrent
ย ย ย ย at com.frostwire.jlibtorrent.swig.libtorrent_jni.(libtorrent_jni.java:22)
ย ย ย ย at com.frostwire.jlibtorrent.swig.libtorrentConstants.(libtorrentConstants.java:12)
ย ย ย ย at com.frostwire.jlibtorrent.LibTorrent.version(LibTorrent.java:16)
ย ย ย ย at com.torrenttunes.client.LibtorrentEngine.(LibtorrentEngine.java:120)
ย ย ย ย at com.torrenttunes.client.LibtorrentEngine.(LibtorrentEngine.java:96)
ย ย ย ย at com.torrenttunes.client.db.Actions.updateLibtorrentSettings(Actions.java:122)
ย ย ย ย at com.torrenttunes.client.Main.setupSettings(Main.java:95)
ย ย ย ย at com.torrenttunes.client.Main.doMain(Main.java:71)
ย ย ย ย at com.torrenttunes.client.Main.main(Main.java:128)

Getting seeders and leechers count

Hello Frostwire,

I cannot seem to find this anywhere(in the source), i would love to know, how would one find the number of seeders and leechers from a magnet link ?

Thank You for reading.

Ability to instantiate jlibtorrent using a custom binary/library path.

Its much much easier, instead of trying to fiddle around with the java.library.path, to use the following code in libtorrent_jni.java to load the correct jlibtorrent binary. In other words, setting the binary path explicitly in code as opposed to using command line params.

For example, my program works for mac, linux, and windows, simply by returning the correct binary:

System.loadLibrary("jlibtorrent"); // Get rid of this line
System.load(DataSources.LIBTORRENT_OS_LIBRARY_PATH()); // Chooses the correct binary depending on the system OS.

And you guys could create a general constructor, that can optionally use that path:

LibTorrent.setup(LOCATION_OF_BINARY);
System.out.println(LibTorrent.version());

How to edit and save a .torrent file(Just for reference).

So I just wanted to post the question and answer for a problem I just figured out how to solve. You guys might think it worth adding to the examples.

I needed to change the tracker on a ton of my .torrent files, since demonii got shut down, and my torrent's only have 1 tracker and no DHT(for network reasons... there are thousands of them.)

Anyway, here's the method for how to do this:

public static void updateTrackerForTorrent(File torrentFile) {

        TorrentInfo ti = new TorrentInfo(torrentFile);

        create_torrent t = new create_torrent(ti.getSwig());

        // Changing the tracker
        for (URI announce : DataSources.ANNOUNCE_LIST()) {
            t.add_tracker(announce.toASCIIString());
        }


        // Get the bencode and write the file
        Entry entry =  new Entry(t.generate());

        Map<String, Entry> entryMap = entry.dictionary();
        Entry entryFromUpdatedMap = Entry.fromMap(entryMap);
        final byte[] bencode = entryFromUpdatedMap.bencode();

        FileOutputStream fos;

        try {
            fos = new FileOutputStream(torrentFile);

            BufferedOutputStream bos = new BufferedOutputStream(fos);
            bos.write(bencode);
            bos.flush();
            bos.close();

            log.info("Trackers updated for torrent: " + torrentFile.getName());
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

MillionTorrentTester

@aldenml I've worked up the torrent tester example. I'm not sure a pull request would be the best way to give it to you, so I'll just put the code for the class here.

I'd highly suggest also adding the createAndSaveTorrent(or portions of it) into jlibtorrent, because its very useful.

Apologies in advance for the verbose amount of listeners, but IMO its better than the tick.

package com.torrenttunes.client.tools;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URI;
import java.util.Map;

import com.frostwire.jlibtorrent.Entry;
import com.frostwire.jlibtorrent.Session;
import com.frostwire.jlibtorrent.SessionSettings;
import com.frostwire.jlibtorrent.TorrentAlertAdapter;
import com.frostwire.jlibtorrent.TorrentHandle;
import com.frostwire.jlibtorrent.alerts.AddTorrentAlert;
import com.frostwire.jlibtorrent.alerts.BlockDownloadingAlert;
import com.frostwire.jlibtorrent.alerts.BlockFinishedAlert;
import com.frostwire.jlibtorrent.alerts.BlockTimeoutAlert;
import com.frostwire.jlibtorrent.alerts.DhtReplyAlert;
import com.frostwire.jlibtorrent.alerts.FastresumeRejectedAlert;
import com.frostwire.jlibtorrent.alerts.FileErrorAlert;
import com.frostwire.jlibtorrent.alerts.HashFailedAlert;
import com.frostwire.jlibtorrent.alerts.PeerBanAlert;
import com.frostwire.jlibtorrent.alerts.PeerBlockedAlert;
import com.frostwire.jlibtorrent.alerts.PeerConnectAlert;
import com.frostwire.jlibtorrent.alerts.PeerDisconnectedAlert;
import com.frostwire.jlibtorrent.alerts.PeerErrorAlert;
import com.frostwire.jlibtorrent.alerts.PeerSnubbedAlert;
import com.frostwire.jlibtorrent.alerts.PeerUnsnubbedAlert;
import com.frostwire.jlibtorrent.alerts.PerformanceAlert;
import com.frostwire.jlibtorrent.alerts.RequestDroppedAlert;
import com.frostwire.jlibtorrent.alerts.SaveResumeDataAlert;
import com.frostwire.jlibtorrent.alerts.SaveResumeDataFailedAlert;
import com.frostwire.jlibtorrent.alerts.ScrapeFailedAlert;
import com.frostwire.jlibtorrent.alerts.ScrapeReplyAlert;
import com.frostwire.jlibtorrent.alerts.StateChangedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentAddedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentCheckedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentDeleteFailedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentDeletedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentErrorAlert;
import com.frostwire.jlibtorrent.alerts.TorrentFinishedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentPausedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentPrioritizeAlert;
import com.frostwire.jlibtorrent.alerts.TorrentRemovedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentResumedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentUpdateAlert;
import com.frostwire.jlibtorrent.alerts.TrackerAnnounceAlert;
import com.frostwire.jlibtorrent.alerts.TrackerErrorAlert;
import com.frostwire.jlibtorrent.alerts.TrackerReplyAlert;
import com.frostwire.jlibtorrent.alerts.TrackerWarningAlert;
import com.frostwire.jlibtorrent.alerts.UnwantedBlockAlert;
import com.frostwire.jlibtorrent.swig.create_torrent;
import com.frostwire.jlibtorrent.swig.error_code;
import com.frostwire.jlibtorrent.swig.file_storage;
import com.frostwire.jlibtorrent.swig.libtorrent;
import com.google.common.io.Files;

//java -cp target/torrenttunes-client.jar com.torrenttunes.client.tools.MillionTorrentTester
public class MillionTorrentTester {

    public static void main(String[] args) throws IOException {

        Session session = new Session();
        SessionSettings sessionSettings = SessionSettings.newDefaults();

        sessionSettings.setActiveDownloads(10);
        sessionSettings.setActiveLimit(999999);
        sessionSettings.setActiveSeeds(999999);
        sessionSettings.setActiveTrackerLimit(999999);
        session.stopLSD();
        session.stopDHT();


        session.setSettings(sessionSettings);


        for (int i = 0; i < 10000; i++) {
            System.out.println(i);
            File torrentFile = File.createTempFile("t_" + i + "_", ".torrent");
            File inputFileOrDir = File.createTempFile("f_" + i + "_", ".tmp");
            Files.write("1".getBytes(), inputFileOrDir);

            File tFile = createAndSaveTorrent(torrentFile, inputFileOrDir);

            TorrentHandle torrent = session.addTorrent(tFile, inputFileOrDir.getParentFile());

            torrent.setAutoManaged(false);
            torrent.resume();

            addListeners(session, torrent);

            System.out.println("Added file " + tFile.getAbsolutePath());

        }

        System.out.println("Press ENTER to exit");
        System.in.read();


    }

    private static File createAndSaveTorrent(File torrentFile, File inputFileOrDir) {

        file_storage fs = new file_storage();

        // Add the file
        libtorrent.add_files(fs, inputFileOrDir.getAbsolutePath());

        create_torrent t = new create_torrent(fs);


        // Add trackers in tiers
        for (URI announce : DataSources.ANNOUNCE_LIST()) {
            t.add_tracker(announce.toASCIIString());
        }


        t.set_priv(false);
        t.set_creator(System.getProperty("user.name"));

        error_code ec = new error_code();


        // reads the files and calculates the hashes
        libtorrent.set_piece_hashes(t, inputFileOrDir.getParent(), ec);

        if (ec.value() != 0) {
            System.out.println(ec.message());
        }

        // Get the bencode and write the file
        Entry entry =  new Entry(t.generate());

        Map<String, Entry> entryMap = entry.dictionary();
        Entry entryFromUpdatedMap = Entry.fromMap(entryMap);
        final byte[] bencode = entryFromUpdatedMap.bencode();

        try {
            FileOutputStream fos;

            fos = new FileOutputStream(torrentFile);

            BufferedOutputStream bos = new BufferedOutputStream(fos);
            bos.write(bencode);
            bos.flush();
            bos.close();
        } catch (IOException e) {
            System.err.println("Couldn't write file");
            e.printStackTrace();
        }

        return torrentFile;
    }

    private static void addListeners(Session session, TorrentHandle torrent) {
        // Add the listeners
                session.addListener(new TorrentAlertAdapter(torrent) {

                    //          @Override
                    //          public void stats(StatsAlert alert) {
                    //              TorrentStats ts = TorrentStats.create(torrent);
                    //              System.out.println(ts.toString());
                    //
                    //              super.stats(alert);
                    //          }

                    @Override
                    public void stateChanged(StateChangedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void scrapeFailed(ScrapeFailedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }


                    @Override
                    public void blockFinished(BlockFinishedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void torrentFinished(TorrentFinishedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                        //              torrent.saveResumeData();
                    }

                    @Override
                    public void blockDownloading(BlockDownloadingAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void peerConnect(PeerConnectAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }
                    @Override
                    public void peerSnubbed(PeerSnubbedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());

                    }

                    @Override
                    public void peerUnsnubbe(PeerUnsnubbedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void requestDropped(RequestDroppedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void saveResumeData(SaveResumeDataAlert alert) {
//                      System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
//                      Entry srdata = alert.getResumeData();
//                      try {
//                          String srDataPath = DataSources.TORRENTS_DIR() + "/srdata_" + torrent.getName();
//                          Files.write(Paths.get(srDataPath), 
//                                  srdata.bencode());
//                          System.out.println("Wrote save_resume_data: " + srDataPath);
//                      } catch (IOException e) {
//                          // TODO Auto-generated catch block
//                          e.printStackTrace();
//                      }



                    }


                    @Override
                    public void saveResumeDataFailed(SaveResumeDataFailedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void peerDisconnected(PeerDisconnectedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void peerBan(PeerBanAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());

                    }

                    @Override
                    public void peerError(PeerErrorAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());

                    }

                    @Override
                    public void addTorrent(AddTorrentAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void peerBlocked(PeerBlockedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());

                    }

                    @Override
                    public void trackerAnnounce(TrackerAnnounceAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());

                    }

                    @Override
                    public void trackerReply(TrackerReplyAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                        //              torrent.setAutoManaged(false);
                        //              torrent.pause();
                        //              torrent.saveResumeData();
                    }

                    @Override
                    public void trackerWarning(TrackerWarningAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());

                    }

                    @Override
                    public void trackerError(TrackerErrorAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());

                    }


                    @Override
                    public void dhtReply(DhtReplyAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                        //              torrent.setAutoManaged(true);
                    }

                    @Override
                    public void torrentPaused(TorrentPausedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());

//                      torrent.saveResumeData();
                        //              torrent.resume();
                    }

                    @Override
                    public void torrentError(TorrentErrorAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void torrentResumed(TorrentResumedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void torrentUpdate(TorrentUpdateAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }


                    @Override
                    public void torrentChecked(TorrentCheckedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void torrentRemoved(TorrentRemovedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void torrentAdded(TorrentAddedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void torrentDeleted(TorrentDeletedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void torrentDeleteFailed(TorrentDeleteFailedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());

                    }


                    @Override
                    public void fastresumeRejected(FastresumeRejectedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void blockTimeout(BlockTimeoutAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void fileError(FileErrorAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void hashFailed(HashFailedAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void performance(PerformanceAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void scrapeReply(ScrapeReplyAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void torrentPrioritize(TorrentPrioritizeAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }

                    @Override
                    public void unwantedBlock(UnwantedBlockAlert alert) {
                        System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                    }


                });




    }
}

build.gradle is using unset ossrhUsername and ossrhPassword properties

There is a problem on lines #137 and #141 in build.gradle file; unset properties are used for authentication that lead to error when executing the Gradle build.

Suggest the following fix (for both lines):

authentication( userName: hasProperty('ossrhUsername')?ossrhUsername:'', password: hasProperty('ossrhPassword')?ossrhPassword:'' )

problem reproduced with

Gradle: 2.10
Groovy: 2.4.4
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_60 (Oracle Corporation 25.60-b23)
OS: Mac OS X 10.11.2 x86_64

[Linux-build] /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11

g++ -Wno-c++11-extensions -std=c++11 -Iinclude -I/usr/lib/jvm/java-1.7.0-openjdk-amd64/include -c -o obj/jlibtorrent.o src/jlibtorrent.cpp
g++ -Wno-c++11-extensions -std=c++11 -Iinclude -I/usr/lib/jvm/java-1.7.0-openjdk-amd64/include -c -o obj/LibTorrent.o src/LibTorrent.cpp
g++ -Wno-c++11-extensions -std=c++11 -Iinclude -I/usr/lib/jvm/java-1.7.0-openjdk-amd64/include -c -o obj/Session.o src/Session.cpp
g++ -Wno-c++11-extensions -std=c++11 -Iinclude -I/usr/lib/jvm/java-1.7.0-openjdk-amd64/include -c -o obj/TorrentInfo.o src/TorrentInfo.cpp
g++ -L/usr/local/lib -ltorrent-rasterbar -lboost_system -dynamiclib -o jlibtorrent.so obj/jlibtorrent.o obj/LibTorrent.o obj/Session.o obj/TorrentInfo.o
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 21
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
obj/jlibtorrent.o: In function `__static_initialization_and_destruction_0(int, int)':
jlibtorrent.cpp:(.text+0x44): undefined reference to `boost::system::generic_category()'
jlibtorrent.cpp:(.text+0x50): undefined reference to `boost::system::generic_category()'
jlibtorrent.cpp:(.text+0x5c): undefined reference to `boost::system::system_category()'
jlibtorrent.cpp:(.text+0x74): undefined reference to `boost::asio::error::get_netdb_category()'
jlibtorrent.cpp:(.text+0x80): undefined reference to `boost::asio::error::get_addrinfo_category()'
jlibtorrent.cpp:(.text+0x8c): undefined reference to `boost::asio::error::get_misc_category()'
obj/jlibtorrent.o: In function `boost::asio::error::get_system_category()':
jlibtorrent.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[_ZN5boost4asio5error19get_system_categoryEv]+0x5): undefined reference to `boost::system::system_category()'
obj/LibTorrent.o: In function `__static_initialization_and_destruction_0(int, int)':
LibTorrent.cpp:(.text+0xb9): undefined reference to `boost::system::generic_category()'
LibTorrent.cpp:(.text+0xc5): undefined reference to `boost::system::generic_category()'
LibTorrent.cpp:(.text+0xd1): undefined reference to `boost::system::system_category()'
LibTorrent.cpp:(.text+0xe9): undefined reference to `boost::asio::error::get_netdb_category()'
LibTorrent.cpp:(.text+0xf5): undefined reference to `boost::asio::error::get_addrinfo_category()'
LibTorrent.cpp:(.text+0x101): undefined reference to `boost::asio::error::get_misc_category()'
obj/Session.o: In function `session_create':
Session.cpp:(.text+0x69): undefined reference to `libtorrent::session::set_alert_mask(unsigned int)'
obj/Session.o: In function `session_release':
Session.cpp:(.text+0xac): undefined reference to `libtorrent::session::~session()'
obj/Session.o: In function `session_start_upnp':
Session.cpp:(.text+0xd3): undefined reference to `libtorrent::session::start_upnp()'
obj/Session.o: In function `session_start_natpmp':
Session.cpp:(.text+0xed): undefined reference to `libtorrent::session::start_natpmp()'
obj/Session.o: In function `session_start_lsd':
Session.cpp:(.text+0x107): undefined reference to `libtorrent::session::start_lsd()'
obj/Session.o: In function `session_start_dht':
Session.cpp:(.text+0x121): undefined reference to `libtorrent::session::start_dht()'
obj/Session.o: In function `session_stop_upnp':
Session.cpp:(.text+0x13b): undefined reference to `libtorrent::session::stop_upnp()'
obj/Session.o: In function `session_stop_natpmp':
Session.cpp:(.text+0x155): undefined reference to `libtorrent::session::stop_natpmp()'
obj/Session.o: In function `session_stop_lsd':
Session.cpp:(.text+0x16f): undefined reference to `libtorrent::session::stop_lsd()'
obj/Session.o: In function `session_stop_dht':
Session.cpp:(.text+0x189): undefined reference to `libtorrent::session::stop_dht()'
obj/Session.o: In function `session_wait_for_alert':
Session.cpp:(.text+0x1d0): undefined reference to `libtorrent::session::wait_for_alert(libtorrent::time_duration)'
Session.cpp:(.text+0x1ed): undefined reference to `libtorrent::session::pop_alerts(std::deque<libtorrent::alert*, std::allocator<libtorrent::alert*> >*)'
obj/Session.o: In function `__static_initialization_and_destruction_0(int, int)':
Session.cpp:(.text+0x914): undefined reference to `boost::system::generic_category()'
Session.cpp:(.text+0x920): undefined reference to `boost::system::generic_category()'
Session.cpp:(.text+0x92c): undefined reference to `boost::system::system_category()'
Session.cpp:(.text+0x944): undefined reference to `boost::asio::error::get_netdb_category()'
Session.cpp:(.text+0x950): undefined reference to `boost::asio::error::get_addrinfo_category()'
Session.cpp:(.text+0x95c): undefined reference to `boost::asio::error::get_misc_category()'
obj/Session.o: In function `libtorrent::session::session(libtorrent::fingerprint const&, int, unsigned int)':
Session.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x3c): undefined reference to `libtorrent::rel_clocktime_pools_nolog_resolvecountries_deprecated_dht_ext_()'
Session.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x84): undefined reference to `libtorrent::session::init(std::pair<int, int>, char const*, libtorrent::fingerprint const&, int, unsigned int)'
obj/TorrentInfo.o: In function `torrent_info_create':
TorrentInfo.cpp:(.text+0x52): undefined reference to `libtorrent::torrent_info::torrent_info(std::string const&, int)'
obj/TorrentInfo.o: In function `torrent_info_release':
TorrentInfo.cpp:(.text+0xd6): undefined reference to `libtorrent::torrent_info::~torrent_info()'
obj/TorrentInfo.o: In function `info_hash':
TorrentInfo.cpp:(.text+0x171): undefined reference to `libtorrent::to_hex(std::string const&)'
obj/TorrentInfo.o: In function `__static_initialization_and_destruction_0(int, int)':
TorrentInfo.cpp:(.text+0x3cd): undefined reference to `boost::system::generic_category()'
TorrentInfo.cpp:(.text+0x3d9): undefined reference to `boost::system::generic_category()'
TorrentInfo.cpp:(.text+0x3e5): undefined reference to `boost::system::system_category()'
TorrentInfo.cpp:(.text+0x3fd): undefined reference to `boost::asio::error::get_netdb_category()'
TorrentInfo.cpp:(.text+0x409): undefined reference to `boost::asio::error::get_addrinfo_category()'
TorrentInfo.cpp:(.text+0x415): undefined reference to `boost::asio::error::get_misc_category()'
collect2: error: ld returned 1 exit status
make: *** [jlibtorrent.so] Error 1

UnsatisfiedLinkError: com.frostwire.jlibtorrent.swig.libtorrent_jni.new_entry__SWIG_3(Native Method)

private static void testEntryToBencode() {
        entry url_list = new entry(entry.data_type.dictionary_t);
        url_list.list_v().add(new entry("http://server1.com"));
        url_list.list_v().add(new entry("http://server2.com"));
        entry swig_entry = new entry();
        swig_entry.dict().set("url-list", url_list);
        Entry e = new Entry(swig_entry);

        byte[] bencoded_entry = e.bencode();
        lazy_entry lentry = new lazy_entry();
        char_vector charvecBuffer = Vectors.bytes2char_vector(bencoded_entry);
        lazy_entry.bdecode(charvecBuffer, lentry, new error_code());
        libtorrent.print_entry(lentry);
    }

This code causes the following exception on its first line:
entry url_list = new entry(entry.data_type.dictionary_t);

this would also cause it:
entry url_list = new entry();

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.frostwire.jlibtorrent.swig.libtorrent_jni.new_entry__SWIG_3(I)J
    at com.frostwire.jlibtorrent.swig.libtorrent_jni.new_entry__SWIG_3(Native Method)
    at com.frostwire.jlibtorrent.swig.entry.<init>(entry.java:55)
    at com.frostwire.jlibtorrent.demo.DhtNs.testEntryToBencode(DhtNs.java:213)
    at com.frostwire.jlibtorrent.demo.DhtNs.main(DhtNs.java:77)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

I'm just trying to print an Entry, be it using libtorrent.print_entry(lazy_entry le) or by trying to obtain the bencoded value of it via entryJavaWorldObject.bencode()

However, I can't get past that first step when I'm making a mock (C++ to java) entry object.

A proper way to load multiple torrents?

Hello. Let's says I have a TorrenManager class which contains a addTorrent() method(see below) If I want to add more torrents do I need to create new Session and Downloader? Or jsut use previous one?

public void addTorrent () throws Throwable{
  Session s = new Session();
   Downloader d = new Downloader(s);
   DHT dht = new DHT(s);
 File torrentFile = new File(getAppContext().getFilesDir()+"/temp.torrent");
                    final TorrentHandle th = s.addTorrent(torrentFile, new File( Environment.getExternalStorageDirectory() + "/"+ torrentFile.getParentFile()));
                    final CountDownLatch signal = new CountDownLatch(1);
                    s.addListener(new TorrentAlertAdapter(th) {
                        @Override
                        public void blockFinished(BlockFinishedAlert alert) {
                            int p = (int) (th.getStatus(true).getProgress() * 100);
                            progress=p;
                            System.out.println("Progress: " + p + " for torrent name: " + alert.torrentName());
                           // System.out.println(s.getStats().download());
                        }

                        @Override
                        public void torrentFinished(TorrentFinishedAlert alert) {
                            System.out.print("Torrent finished");
                            int p = (int) (th.getStatus(true).getProgress() * 100);
                            progress=p;
                            System.out.println("Progress: " + p + " for torrent name: " + alert.torrentName());


                            signal.countDown();
                        }
                    });

                    th.resume();

                    signal.await();
}

Crash SIGSEGV

A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x00007ff218585f2b, pid=9787, tid=140677636507392

JRE version: Java(TM) SE Runtime Environment (7.0_80-b15) (build 1.7.0_80-b15)
Java VM: Java HotSpot(TM) 64-Bit Server VM (24.80-b11 mixed mode linux-amd64 compressed oops)
Problematic frame:
C [libjlibtorrent.so+0x344f2b] boost::detail::shared_count::shared_count(boost::detail::weak_count const&, boost::detail::sp_nothrow_tag)+0xb

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.

--------------- T H R E A D ---------------

Current thread (0x00007ff1dd800000): JavaThread "Thread-3" daemon [_thread_in_native, id=9811, stack(0x00007ff2107d4000,0x00007ff2108d5000)]

siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x0000000000000007

Registers:
RAX=0x00000000ebc50f38, RBX=0x00007ff2108d36e0, RCX=0x00007ff2108d3718, RDX=0xffffffffffffffff
RSP=0x00007ff2108d3698, RBP=0x00007ff1f82b6130, RSI=0x00007ff1f82b6138, RDI=0x00007ff2108d36b8
R8 =0x0000000000000095, R9 =0x0000000000000095, R10=0x00007ff21d0e4935, R11=0x00000000ebc50f50
R12=0x0000000000000000, R13=0x00000000ee551140, R14=0x00007ff2108d3740, R15=0x00007ff1dd800000
RIP=0x00007ff218585f2b, EFLAGS=0x0000000000010286, CSGSFS=0x0000000000000033, ERR=0x0000000000000004
TRAPNO=0x000000000000000e

Top of Stack: (sp=0x00007ff2108d3698)
0x00007ff2108d3698: 00007ff21861e077 00007ff2108d3700
0x00007ff2108d36a8: 00000000ee551140 0000000000000000
0x00007ff2108d36b8: ffffffffffffffff 00007ff2108d3700
0x00007ff2108d36c8: 00007ff1dd8001e8 00007ff2108d3750
0x00007ff2108d36d8: 00007ff2184cb9ec 0000000000000000
0x00007ff2108d36e8: 0000000000000000 0000000000000000
0x00007ff2108d36f8: 0000000000000000 00000000ebc50f00
0x00007ff2108d3708: 00007ff21d0e49a7 0000000000000000
0x00007ff2108d3718: 00000000ee551160 00007ff2108d3740
0x00007ff2108d3728: 00007ff1dd800000 00007ff2108d3750
0x00007ff2108d3738: 00007ff2269aa003 00000000c4b57fa0
0x00007ff2108d3748: 000000000006af96 00000000c34c51d8
0x00007ff2108d3758: 00007ff21d42dcd8 00000000ec44a578
0x00007ff2108d3768: 00000000ec44ab08 00000000c34678f8
0x00007ff2108d3778: 00007ff200000009 0000000000000007
0x00007ff2108d3788: 0000000000000000 00000000c47b4ef8
0x00007ff2108d3798: bf3822d80000000b 00000000c4b4a6d0
0x00007ff2108d37a8: 00000000ee529ea8 00000000c55b9ed0
0x00007ff2108d37b8: 00000000c34c51e8 bff0000000000000
0x00007ff2108d37c8: 000000005efbca51 00000000c4b4a6c0
0x00007ff2108d37d8: 00000000c55b9ec0 00000000ebc50f38
0x00007ff2108d37e8: 00000000ebc50b50 00000000c55b9ec0
0x00007ff2108d37f8: 00000000c55b9ec0 00000000ebc29b20
0x00007ff2108d3808: 00000000ebc29e58 00000000ee529ea8
0x00007ff2108d3818: 0000000000000072 00000000ebc2a070
0x00007ff2108d3828: 00000000c55b9ec0 0000000000000038
0x00007ff2108d3838: 00000000ebc2a600 00000000ee529ef0
0x00007ff2108d3848: 00000000ebc50b18 00000000c34678f8
0x00007ff2108d3858: 0000000000000000 0000000000000035
0x00007ff2108d3868: 00000000ece9b9b0 00007ff2108d38f0
0x00007ff2108d3878: 00007ff21d0004e7 00000000c47b4ef8
0x00007ff2108d3888: 00000000c4ad4660 00007ff200001fa0

Instructions: (pc=0x00007ff218585f2b)
0x00007ff218585f0b: 80 00 00 00 00 48 8b 07 ff 50 18 eb de 0f 1f 84
0x00007ff218585f1b: 00 00 00 00 00 48 8b 16 48 85 d2 48 89 17 74 1d
0x00007ff218585f2b: 8b 42 08 85 c0 74 0b 89 c1 ff c1 f0 0f b1 4a 08
0x00007ff218585f3b: 75 f1 85 c0 75 07 48 c7 07 00 00 00 00 f3 c3 66

Register to memory mapping:

RAX=0x00000000ebc50f38 is an oop
com.frostwire.jlibtorrent.swig.sha1_hash

  • klass: 'com/frostwire/jlibtorrent/swig/sha1_hash'
    RBX=0x00007ff2108d36e0 is pointing into the stack for thread: 0x00007ff1dd800000
    RCX=0x00007ff2108d3718 is pointing into the stack for thread: 0x00007ff1dd800000
    RDX=0xffffffffffffffff is an unknown value
    RSP=0x00007ff2108d3698 is pointing into the stack for thread: 0x00007ff1dd800000
    RBP=0x00007ff1f82b6130 is an unknown value
    RSI=0x00007ff1f82b6138 is an unknown value
    RDI=0x00007ff2108d36b8 is pointing into the stack for thread: 0x00007ff1dd800000
    R8 =0x0000000000000095 is an unknown value
    R9 =0x0000000000000095 is an unknown value
    R10=0x00007ff21d0e4935 is at entry_point+85 in (nmethod*)0x00007ff21d0e4750
    R11=0x00000000ebc50f50 is an unknown value
    R12=0x0000000000000000 is an unknown value
    R13=0x00000000ee551140 is an oop
    com.frostwire.jlibtorrent.TorrentHandle
  • klass: 'com/frostwire/jlibtorrent/TorrentHandle'
    R14=0x00007ff2108d3740 is pointing into the stack for thread: 0x00007ff1dd800000
    R15=0x00007ff1dd800000 is a thread

Stack: [0x00007ff2107d4000,0x00007ff2108d5000], sp=0x00007ff2108d3698, free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libjlibtorrent.so+0x344f2b] boost::detail::shared_count::shared_count(boost::detail::weak_count const&, boost::detail::sp_nothrow_tag)+0xb

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 984 com.frostwire.jlibtorrent.swig.libtorrent_jni.torrent_handle_info_hash(JLcom/frostwire/jlibtorrent/swig/torrent_handle;)J (0 bytes) @ 0x00007ff21d0e4935 [0x00007ff21d0e48e0+0x55]
J 1436% C2 Torrent.run()V (917 bytes) @ 0x00007ff21d42dcd8 [0x00007ff21d42d860+0x478]
v ~StubRoutines::call_stub

OS: Ubuntu 14.04 64 bit

Is this enough information?

How to turn on PeerLog alerts/ Peer Logging?

@arvidn is recommending that I do some logging of PeerLog, and I have the code to do them, but I don't know how to turn the logging on.

He told me :

In 1.1.0 you don't need to rebuild libtorrent to enable verbose peer logging, they are alerts now that can be enabled with an alert mask flag.

Here's my code thats not doing anything :(

        session.addListener(new AlertListener() {

            @Override
            public int[] types() {
                return new int[]{AlertType.SESSION_STATS.getSwig(), AlertType.PEER_LOG.getSwig()};

            }
@Override
public void alert(Alert<?> alert) {
   if (alert instanceof PeerLogAlert) {
                        log.debug("peer log alert");
                        log.debug(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
                        log.debug(((PeerLogAlert) alert).eventType());
                        log.debug(((PeerLogAlert) alert).direction().toString());
                        log.debug(((PeerLogAlert) alert).getPeerId().toString());
                        log.debug(((PeerLogAlert) alert).getPeerIP().toString());
                    }

Building for linux(ubuntu)

The build instructions for linux are a bit unclear, and I'm having some problems.

So i downloaded libtorrent-rasterbar-1.0.5, (had to install boost as well for ubuntu which was unforeseen), ran make and make install, and it installed fine.

The run_swig.sh script didn't work in its directory, and neither did build_linux.sh.

I have no idea where the libtorrent root directories or libtorrent library dirs on my system should be. I'm running ubuntu.

[CRASH] libtorrent::piece_picker::update(int, int)

Android 5.0
reported on FrostWire 1.6.2

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/hlteuc/hlteatt:5.0/LRX21V/N900AUCUEOC2:user/release-keys'
Revision: '8'
ABI: 'arm'
pid: 20249, tid: 20288, name: ostwire.android >>> com.frostwire.android <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x5e921b4c
r0 98873169 r1 000000f4 r2 ffffffff r3 000002e6
r4 0000003d r5 929614c0 r6 5e921b48 r7 00000000
r8 0000003d r9 00001730 sl 000002e6 fp 9a589000
ip fffffffc sp b3abcb50 lr 00000053 pc a28ec40e cpsr 00031830

backtrace:
#00 pc 002cd40e /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::piece_picker::update(int, int)+277)
#01 pc 002ced63 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::piece_picker::update_piece_state(__gnu_cxx::__normal_iterator<libtorrent::piece_picker::downloading_piece*, std::vector<libtorrent::piece_picker::downloading_piece, std::allocator<libtorrent::piece_picker::downloading_piece> > >)+474)
#02 pc 002cef4b /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::piece_picker::set_piece_priority(int, int)+274)
#03 pc 00348885 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::torrent::prioritize_pieces(std::vector<int, std::allocator<int> > const&)+120)
#04 pc 00348a6b /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::torrent::update_piece_priorities()+294)
#05 pc 00348c75 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::torrent::prioritize_files(std::vector<int, std::allocator<int> > const&)+464)
#06 pc 0037868d /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost::asio::detail::completion_handler<boost::_bi::bind_t<void, boost::_mfi::mf1<void, libtorrent::torrent, std::vector<int, std::allocator<int> > const&>, boost::_bi::list2<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> >, boost::_bi::value<std::vector<int, std::allocator<int> > > > > >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code co #07 pc 002db3c1 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost::asio::io_service::run()+648)
#08 pc 002884f9 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost_asio_detail_posix_thread_function+80)
#09 pc 000137bb /system/lib/libc.so (__pthread_start(void*)+30)
#10 pc 0001189b /system/lib/libc.so (__start_thread+6)

SIGSEGV on Android

So I tried to replace my previous version of jlibtorrent binaries and library code by the maven repositories in Gradle.

Can something be wrong with the binaries? The previous version worked perfectly and this is what's happening now:

08-07 11:21:44.092 29229-29412/pct.droid.dev A/libc๏น• Fatal signal 11 (SIGSEGV), code 1, fault addr 0xe02fa40 in tid 29412 (Session-alertsL)

I first thought that it happened after I added my second listener. But it doesn't. Debugging in Android Studio tells me that some blocks are being finished. And then suddenly some alert comes (I guess, looking at the error) and the app crashes.

How to set enum types of SettingsPack settings?

I'm trying to get jlibtorrent to prefer TCP over uTP, and I ned to set Bandwidth_Mixed_Algo, or Mixed_Mode_Algorithm to prefer TCP.

I used to be able to do sessionSettings.setMixedModeAlgorithm(BandwidthMixedAlgo.PEER_PROPORTIONAL);

How do I do this now?

Download Torrent on Android

I'm trying to download a .torrent with frostwire-jlibtorrent library. I copy the sources directly in my project source folder like https://github.com/frostwire/frostwire-jlibtorrent says and I did a simple Activity to run it on a phone. I have no errors doing that but the download never starts. I used the example code from github frostwire and nothing.

I don't understand what I'm doing wrong. The source code is this:

File torrentFile = new File("/sdcard/torr.torrent");

System.out.println("Using libtorrent version: " + LibTorrent.version());

final Session s = new Session();

final TorrentHandle th = s.addTorrent(torrentFile, torrentFile.getParentFile());

final CountDownLatch signal = new CountDownLatch(1);

s.addListener(new TorrentAlertAdapter(th) {
    @Override
    public void onBlockFinished(BlockFinishedAlert alert) {
        int p = (int) (th.getStatus().getProgress() * 100);
        System.out.println("Progress: " + p);
    }

    @Override
    public void onTorrentFinished(TorrentFinishedAlert alert) {
        System.out.print("Torrent finished");
        signal.countDown();
    }
});

th.resume();

signal.await();

I can see the torrent data, like name or the files inside it but I can't download it.

Please help I really need it :/

Problems with frostwire-jlibtorrent-linux artifact(libjlibtorrent.so) on linux kernel versions 4.x

I'm currently using the pre-built linux libjlibtorrent.so version 1.1.0.6 from here:

http://mvnrepository.com/artifact/com.frostwire/jlibtorrent-linux

Someone running my client is getting the following error(on kernel version 4.1.6-200.fc22.x86_64):

Exception in thread "main" java.lang.UnsatisfiedLinkError: Look for your architecture binary instructions at: https://github.com/frostwire/frostwire-jlibtorrent

I think we've narrowed it down to a linux kernel version issue: I have many of these clients running on various versions of linux 3.x, but hadn't tried 4.x yet.

What would be the best way to solve this issue?

[CRASH] libtorrent::piece_picker::add(int) / SIGFPE (Arithmethic Error)

Application version: 1.6.3 (current staged rollout)
Android version: Android 5.0
Device: Galaxy Note4 (tritecan)

The SIGFPE signal reports a fatal arithmetic error. Although the name is derived from โ€œfloating-point exceptionโ€, this signal actually covers all arithmetic errors, including division by zero and overflow. If a program stores integer data in a location which is then used in a floating-point operation, this often causes an โ€œinvalid operationโ€ exception, because the processor cannot recognize the data as a floating-point number.
-gnu.org

Build fingerprint: 'samsung/trltecan/trltecan:5.0.1/LRX22C/N910W8VLU1BOE2:user/release-keys'
Revision: '12'
ABI: 'arm'
pid: 4351, tid: 4380, name: ostwire.android >>> com.frostwire.android <<<
signal 8 (SIGFPE), code -6 (SI_TKILL), fault addr 0x10ff
r0 00000000 r1 0000111c r2 00000008 r3 00000000
r4 b3bbbdb8 r5 00000008 r6 00000000 r7 0000010c
r8 0000029c r9 00000540 sl 000000a8 fp 00000000
ip 0000111c sp b3bbbb60 lr b6f61fd1 pc b6f85b4c cpsr 600f0010

backtrace:
#00 pc 00037b4c /system/lib/libc.so (tgkill+12)
#01 pc 00013fcd /system/lib/libc.so (pthread_kill+52)
#02 pc 00014beb /system/lib/libc.so (raise+10)
#03 pc 0057d994 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (__aeabi_idiv0+8)
#04 pc 002d99a1 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::piece_picker::add(int)+140)
#05 pc 002db9c5 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::piece_picker::set_piece_priority(int, int)+516)
#06 pc 00355161 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::torrent::prioritize_pieces(std::vector<int, std::allocator<int> > const&)+188)
#07 pc 0035533b /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::torrent::update_piece_priorities()+330)
#08 pc 00355549 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::torrent::prioritize_files(std::vector<int, std::allocator<int> > const&)+464)
#09 pc 0038517d /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost::asio::detail::completion_handler<boost::_bi::bind_t<void, boost::_mfi::mf1<void, libtorrent::torrent, std::vector<int, std::allocator<int> > const&>, boost::_bi::list2<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> >, boost::_bi::value<std::vector<int, std::allocator<int> > > > > >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code co #10 pc 002e7c69 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost::asio::io_service::run()+648)
#11 pc 0029b151 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost_asio_detail_posix_thread_function+80)
#12 pc 000137bb /system/lib/libc.so (__pthread_start(void*)+30)
#13 pc 0001189b /system/lib/libc.so (__start_thread+6)

[Mac-build issue]

Right after it builds (with clang, can't build with g++ anymore for some unknown reason)

Undefined symbols for architecture x86_64:
  "libtorrent::torrent_info::torrent_info(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
      _torrent_info_create in TorrentInfo.o
  "libtorrent::to_hex(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _info_hash in TorrentInfo.o
  "libtorrent::session::pop_alerts(std::__1::deque<libtorrent::alert*, std::__1::allocator<libtorrent::alert*> >*)", referenced from:
      _session_wait_for_alert in Session.o
  "libtorrent::session::init(std::__1::pair<int, int>, char const*, libtorrent::fingerprint const&, unsigned int)", referenced from:
      libtorrent::session::session(libtorrent::fingerprint const&, int, unsigned int) in Session.o
  "std::runtime_error::what() const", referenced from:
      boost::system::system_error::what() const in LibTorrent.o
      vtable for NewJavaException in LibTorrent.o
      vtable for ThrownJavaException in LibTorrent.o
      vtable for NewJavaError in LibTorrent.o
      boost::system::system_error::what() const in Session.o
      vtable for NewJavaError in Session.o
      vtable for NewJavaException in Session.o
      ...
  "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in create_torrent.o
  "std::__1::ios_base::getloc() const", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in create_torrent.o
  "std::runtime_error::runtime_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      ThrownJavaException::ThrownJavaException(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in LibTorrent.o
      ThrownJavaException::ThrownJavaException(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Session.o
      ThrownJavaException::ThrownJavaException(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in TorrentInfo.o
  "std::runtime_error::~runtime_error()", referenced from:
      boost::system::system_error::~system_error() in LibTorrent.o
      ThrownJavaException::~ThrownJavaException() in LibTorrent.o
      boost::system::system_error::~system_error() in Session.o
      ThrownJavaException::~ThrownJavaException() in Session.o
      boost::system::system_error::~system_error() in TorrentInfo.o
      ThrownJavaException::~ThrownJavaException() in TorrentInfo.o
      boost::system::system_error::~system_error() in create_torrent.o
      ...
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)", referenced from:
      NewJavaException::NewJavaException(JNIEnv_*, char const*, char const*) in LibTorrent.o
      NewJavaException::NewJavaException(JNIEnv_*, char const*, char const*) in Session.o
      _torrent_info_create in TorrentInfo.o
      libtorrent::sha1_hash::to_string() const in TorrentInfo.o
      NewJavaException::NewJavaException(JNIEnv_*, char const*, char const*) in TorrentInfo.o
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(unsigned long, char)", referenced from:
      std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char) in create_torrent.o
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*)", referenced from:
      boost::system::system_error::what() const in LibTorrent.o
      NewJavaException::NewJavaException(JNIEnv_*, char const*, char const*) in LibTorrent.o
      boost::system::system_error::what() const in Session.o
      NewJavaException::NewJavaException(JNIEnv_*, char const*, char const*) in Session.o
      boost::system::system_error::what() const in TorrentInfo.o
      NewJavaException::NewJavaException(JNIEnv_*, char const*, char const*) in TorrentInfo.o
      boost::system::system_error::what() const in create_torrent.o
      ...
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long)", referenced from:
      boost::system::system_error::what() const in LibTorrent.o
      boost::system::system_error::what() const in Session.o
      boost::system::system_error::what() const in TorrentInfo.o
      boost::system::system_error::what() const in create_torrent.o
      boost::system::system_error::what() const in jlibtorrent.o
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*)", referenced from:
      boost::system::system_error::what() const in LibTorrent.o
      boost::system::system_error::what() const in Session.o
      boost::system::system_error::what() const in TorrentInfo.o
      boost::system::system_error::what() const in create_torrent.o
      boost::system::system_error::what() const in jlibtorrent.o
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::insert(unsigned long, char const*)", referenced from:
      NewJavaException::NewJavaException(JNIEnv_*, char const*, char const*) in LibTorrent.o
      NewJavaException::NewJavaException(JNIEnv_*, char const*, char const*) in Session.o
      NewJavaException::NewJavaException(JNIEnv_*, char const*, char const*) in TorrentInfo.o
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
      boost::system::system_error::what() const in LibTorrent.o
      boost::system::system_error::~system_error() in LibTorrent.o
      NewJavaException::NewJavaException(JNIEnv_*, char const*, char const*) in LibTorrent.o
      boost::system::system_error::what() const in Session.o
      boost::system::system_error::~system_error() in Session.o
      NewJavaException::NewJavaException(JNIEnv_*, char const*, char const*) in Session.o
      _torrent_info_create in TorrentInfo.o
      ...
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in create_torrent.o
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry()", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in create_torrent.o
  "std::__1::cout", referenced from:
      _main in create_torrent.o
  "std::__1::ctype<char>::id", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in create_torrent.o
  "std::__1::locale::~locale()", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in create_torrent.o
  "std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in create_torrent.o
  "std::__1::ios_base::clear(unsigned int)", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in create_torrent.o
  "std::terminate()", referenced from:
      ___clang_call_terminate in LibTorrent.o
      ___clang_call_terminate in Session.o
      ___clang_call_terminate in TorrentInfo.o
      ___clang_call_terminate in create_torrent.o
      ___clang_call_terminate in jlibtorrent.o
  "typeinfo for std::__1::ios_base::failure", referenced from:
      GCC_except_table31 in LibTorrent.o
      GCC_except_table44 in Session.o
      GCC_except_table42 in TorrentInfo.o
  "typeinfo for std::runtime_error", referenced from:
      typeinfo for boost::system::system_error in LibTorrent.o
      typeinfo for ThrownJavaException in LibTorrent.o
      typeinfo for ThrownJavaException in Session.o
      typeinfo for boost::system::system_error in Session.o
      typeinfo for boost::system::system_error in TorrentInfo.o
      typeinfo for ThrownJavaException in TorrentInfo.o
      typeinfo for boost::system::system_error in create_torrent.o
      ...
  "typeinfo for std::bad_alloc", referenced from:
      GCC_except_table31 in LibTorrent.o
      GCC_except_table44 in Session.o
      GCC_except_table42 in TorrentInfo.o
  "typeinfo for std::exception", referenced from:
      GCC_except_table31 in LibTorrent.o
      GCC_except_table44 in Session.o
      GCC_except_table42 in TorrentInfo.o
  "vtable for __cxxabiv1::__si_class_type_info", referenced from:
      typeinfo for boost::system::system_error in LibTorrent.o
      typeinfo for ThrownJavaException in LibTorrent.o
      typeinfo for NewJavaException in LibTorrent.o
      typeinfo for NewJavaError in LibTorrent.o
      typeinfo for ThrownJavaException in Session.o
      typeinfo for NewJavaException in Session.o
      typeinfo for NewJavaError in Session.o
      ...
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "operator delete(void*)", referenced from:
      boost::system::system_error::~system_error() in LibTorrent.o
      NewJavaException::~NewJavaException() in LibTorrent.o
      ThrownJavaException::~ThrownJavaException() in LibTorrent.o
      NewJavaError::~NewJavaError() in LibTorrent.o
      _session_create in Session.o
      _session_release in Session.o
      _Java_com_frostwire_libtorrent_Session_waitForAlert in Session.o
      ...
  "operator new[](unsigned long)", referenced from:
      _session_wait_for_alert in Session.o
  "operator new(unsigned long)", referenced from:
      _session_create in Session.o
      _torrent_info_create in TorrentInfo.o
  "___cxa_allocate_exception", referenced from:
      _Java_com_frostwire_libtorrent_Session_waitForAlert in Session.o
  "___cxa_begin_catch", referenced from:
      _Java_com_frostwire_libtorrent_LibTorrent_version in LibTorrent.o
      boost::system::system_error::what() const in LibTorrent.o
      translate_cpp_exception(JNIEnv_*) in LibTorrent.o
      ___clang_call_terminate in LibTorrent.o
      _Java_com_frostwire_libtorrent_Session_create in Session.o
      _Java_com_frostwire_libtorrent_Session_release in Session.o
      _Java_com_frostwire_libtorrent_Session_startUPnP in Session.o
      ...
  "___cxa_call_unexpected", referenced from:
      boost::system::system_error::what() const in LibTorrent.o
      boost::system::system_error::what() const in Session.o
      boost::system::system_error::what() const in TorrentInfo.o
      boost::system::system_error::what() const in create_torrent.o
      boost::system::system_error::what() const in jlibtorrent.o
  "___cxa_end_catch", referenced from:
      _Java_com_frostwire_libtorrent_LibTorrent_version in LibTorrent.o
      boost::system::system_error::what() const in LibTorrent.o
      translate_cpp_exception(JNIEnv_*) in LibTorrent.o
      _Java_com_frostwire_libtorrent_Session_create in Session.o
      _Java_com_frostwire_libtorrent_Session_release in Session.o
      _Java_com_frostwire_libtorrent_Session_startUPnP in Session.o
      _Java_com_frostwire_libtorrent_Session_startNATPMP in Session.o
      ...
  "___cxa_free_exception", referenced from:
      _Java_com_frostwire_libtorrent_Session_waitForAlert in Session.o
  "___cxa_rethrow", referenced from:
      translate_cpp_exception(JNIEnv_*) in LibTorrent.o
      translate_cpp_exception(JNIEnv_*) in Session.o
      translate_cpp_exception(JNIEnv_*) in TorrentInfo.o
  "___cxa_throw", referenced from:
      _Java_com_frostwire_libtorrent_Session_waitForAlert in Session.o
  "___gxx_personality_v0", referenced from:
      _Java_com_frostwire_libtorrent_LibTorrent_version in LibTorrent.o
      boost::system::system_error::what() const in LibTorrent.o
      translate_cpp_exception(JNIEnv_*) in LibTorrent.o
      boost::asio::detail::posix_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service_thread_info>::context>::~posix_tss_ptr() in LibTorrent.o
      boost::asio::detail::posix_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service_thread_info>::context>::posix_tss_ptr() in LibTorrent.o
      NewJavaException::NewJavaException(JNIEnv_*, char const*, char const*) in LibTorrent.o
      Dwarf Exception Unwind Info (__eh_frame) in LibTorrent.o
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [jlibtorrent.dylib] Error 1

[CRASH] libtorrent::peer_connection::fill_send_buffer() / SIGSEGV :: SEGV_MAPERR

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/jflteuc/jflteatt:4.4.4/KTU84P/I337UCUFNJ5:user/release-keys'
Revision: '10'
pid: 19666, tid: 19679, name: ostwire.android >>> com.frostwire.android <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000094
r0 72a91b98 r1 000004a4 r2 00000000 r3 0000000c
r4 791af988 r5 791a0670 r6 791a0670 r7 00000008
r8 ffffffff r9 00000000 sl 00000000 fp 00000000
ip 00000008 sp 787c0778 lr 00000025 pc 7830a6c4 cpsr 400f0030
d0 0000000000000000 d1 0000000000000000
d2 0000000000000000 d3 0000000000000000
d4 0000000000000000 d5 0000000000000000
d6 0000000000000000 d7 0000004000000000
d8 0000000000000000 d9 0000000000000000
d10 0000000000000000 d11 0000000000000000
d12 0000000000000000 d13 0000000000000000
d14 0000000000000000 d15 0000000000000000
d16 2e3130312e393031 d17 3a3037312e343232
d18 5a8279995a827999 d19 5a8279995a827999
d20 5a8279995a827999 d21 5a8279995a827999
d22 f8358851be860868 d23 8212f1cb04ba9ffb
d24 1323e09a368c7eba d25 a088f65be91de16d
d26 16f2443ea494bcbe d27 4c869b446eda478d
d28 5a8279995a827999 d29 5a8279995a827999
d30 0000000000000000 d31 0000000000000000
scr 60000010

backtrace:
#00 pc 002726c4 /data/app-lib/com.frostwire.android-17/libjlibtorrent.so (libtorrent::peer_connection::fill_send_buffer()+1583)

code around pc:
7830a6a4 1e6eea4f ba12463a f8d04694 f85221a8 
7830a6b4 ea1c202e f47f0f02 ba3fadbe 21acf8d0 
7830a6c4 202ef852 f47f4217 f894af4a f00225de 
7830a6d4 29020107 af43f73f 68273101 0202f361 
7830a6e4 25def884 4620682e 35e4f8df 9a172104 
7830a6f4 447b9600 47b06dfe 68189b06 fa10f0b5 
7830a704 28009007 829af000 f8df9e06 683015c8 
7830a714 f0b54479 f8d4fa29 68303130 930b461a 
7830a724 689b6813 f0b6930c f8dffb91 ae2035ac 
7830a734 22009f0f f104900d a81d0138 607258fb 
7830a744 6033682a f00f920e aa24fec9 ab1c6b67 
7830a754 46119209 0200f04f f88d4688 46082000 
7830a764 e896601f 93080006 fd12f011 0003e898 
7830a774 ab304646 800cf8d8 e88368b2 f1b80003 
7830a784 f0000f00 f1088238 f3bf0704 e8578f5f 
7830a794 31011f00 1000e847 d1f82800 8f5ff3bf 

code around lr:
00000004 ffffffff ffffffff ffffffff ffffffff 
00000014 ffffffff ffffffff ffffffff ffffffff 
00000024 ffffffff ffffffff ffffffff ffffffff 
00000034 ffffffff ffffffff ffffffff ffffffff 
00000044 ffffffff ffffffff ffffffff ffffffff 
00000054 ffffffff ffffffff ffffffff ffffffff 
00000064 ffffffff ffffffff ffffffff ffffffff 
00000074 ffffffff ffffffff ffffffff ffffffff 
00000084 ffffffff ffffffff ffffffff ffffffff 
00000094 ffffffff ffffffff ffffffff ffffffff 
000000a4 ffffffff ffffffff ffffffff ffffffff 
000000b4 ffffffff ffffffff ffffffff ffffffff 
000000c4 ffffffff ffffffff ffffffff ffffffff 
000000d4 ffffffff ffffffff ffffffff ffffffff 
000000e4 ffffffff ffffffff ffffffff ffffffff 
000000f4 ffffffff ffffffff ffffffff ffffffff 

Windows 64 bit support?

I'm noticing that one of my clients trying to run jlibtorrent with the jlibtorrent.dll from the maven/gradle x86/ folder isn't working. They're currently running Windows 10 64-bit. Would it be possible to add the 64 bit version to that maven/gradle build as well?

dessalines/torrenttunes-client#13

I've tested the jlibtorrent and it does work fine for windows 32 bit.

[CRASH] libtorrent::block_cache::maybe_free_piece(libtorrent::cached_piece_entry*) / SIGSEGV

SIGSEGV = Segmentation Fault
SEGV_MAPERR = Address not mapped to object

Build fingerprint: 'samsung/d2uc/d2att:4.4.2/KOT49H/I747UCUFNJ1:user/release-keys'
Revision: '16'
pid: 30878, tid: 30920, name: ostwire.android >>> com.frostwire.android <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000101
r0 5c48f778 r1 69c8ffa8 r2 00000000 r3 00000101
r4 00000000 r5 69c8ffa8 r6 5c48f778 r7 620f8c08
r8 5c48f488 r9 00000000 sl 620f8c0c fp 620f7ff8
ip 00000001 sp 620f7fc0 lr 61a802a3 pc 61acb85e cpsr 600f0030
d0 0000000000000000 d1 0000000000000000
d2 0000000000000000 d3 0000000000000000
d4 f00c2d56201e1e02 d5 b8d7d10c0f81ff9a
d6 bc3f801042b3a2d7 d7 f260800f00503c07
d8 0000000000000000 d9 0000000000000000
d10 0000000000000000 d11 0000000000000000
d12 0000000000000000 d13 0000000000000000
d14 0000000000000000 d15 0000000000000000
d16 614473746e657272 d17 6972656d412f6174
d18 8afe89951c989d9d d19 df40b9fa388e89da
d20 4a8ea6ef7aa0979b d21 135a4aa56a047933
d22 5784afd3781e86a2 d23 2df227c6b077e45e
d24 e2d0b10bbf28b4ec d25 dcd947fae4251449
d26 55a58605c7059588 d27 3dc7e1c15af712fd
d28 5a8279995a827999 d29 5a8279995a827999
d30 0000000000000000 d31 0000000000000000
scr 60000010

backtrace:
#00 pc 003f585e /data/app-lib/com.frostwire.android-2/libjlibtorrent.so (libtorrent::block_cache::maybe_free_piece(libtorrent::cached_piece_entry*)+65)
#01 pc 003aa29f /data/app-lib/com.frostwire.android-2/libjlibtorrent.so (libtorrent::disk_io_thread::flush_range(libtorrent::cached_piece_entry*, int, int, libtorrent::tailqueue&, boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&)+234)

code around pc:
61acb83c d1422b00 2048f891 0401f012 6a4bd13d 
61acb84c d13a2b00 4049f891 047ff024 6a8bbbac 
61acb85c 681bb10b f002bb8b b3720204 bb63698b 
61acb86c b15e68ce f3bf1d33 e8538f5f 32012f00 
61acb87c 2400e843 d1f82c00 8f5ff3bf 4607ac01 
61acb88c 4620460d fa16f79a 46294638 f7ff4622 
61acb89c b16ef851 f3bf1d33 e8538f5f 1e512f00 
61acb8ac 1000e843 d1f82800 f3bf2a01 d0078f5f 
61acb8bc b0052001 2000bdf0 20004770 bdf0b005 
61acb8cc 4b206832 447b6892 429a681b 68f0d11e 
61acb8dc f12eb108 f106fc63 f3bf0308 e8538f5f 
61acb8ec 1e624f00 2100e843 d1f82900 f3bf2c01 
61acb8fc d1dd8f5f 4b146832 447b68d1 4299681b 
61acb90c 6853d107 47984630 e7d74620 47904630 
61acb91c 4630e7e1 46204788 b186e7d0 f3bf1d33 
61acb92c e8538f5f 1e512f00 1000e843 d1f82800 

code around lr:
61a80280 f7ff4623 4649ff43 f04e4630 1e01ff73 
61a80290 464add03 f04a4630 4630fc33 f04b4629 
61a802a0 4620fabd 46bd3714 8ff0e8bd f6226830 
61a802b0 2301edee e7cd7133 f6226830 f886edee 
61a802c0 e7a99004 4ff0e92d b093460c af046a89 
61a802d0 46924681 2900623b 80e3f000 3044f894 
61a802e0 2042f8b4 030ff003 ea53029b f0001392 
61a802f0 f89480c6 f8d05048 07aa82f0 f8b4d51d 
61a80300 f3cbb046 f1bb0b8d f0400f00 f00581f8 
61a80310 f0050508 2d0002ff 80b1f000 b046f8b4 
61a80320 0b8df3cb 0f00f1bb 80a9f000 46d445da 
61a80330 0300f04f 46dcbfa8 6808e01a 44404641 
61a80340 f1b93801 4603e8d4 d0e02800 b046f8b4 
61a80350 0508f005 0b8df3cb bf024558 0c01f04f 
61a80360 4683b2ea 45dad004 46d4b2ea 46dcbfa8 
61a80370 bf182a00 f1b3465b bf480e01 d4142200 

dht_put_mutable_item and callbacks.

Was looking at session_impl::dht_put_mutable_item and in the C++ world this function takes a callback function as a parameter.

somehow that callback gets bound to a session_impl::put_mutable_callback (I wonder if this binding, is the same as saying that the given callback must implement the interface of the bound function...anyways)

it'd be really nice to have a similar callback mechanism in jlibtorrent and I wonder if it can be done using Java interfaces, the code in C++ looks like this (session_impl.cpp)

void put_mutable_callback(
    alert_manager& alerts, 
    dht::item& i, 
    boost::function<void(entry&, 
                         boost::array<char,64>&,
                         boost::uint64_t&, 
                         std::string const&)> cb)
{
    entry value = i.value();
    boost::array<char, 64> sig = i.sig();
    boost::array<char, 32> pk = i.pk();
    boost::uint64_t seq = i.seq();
    std::string salt = i.salt();
    cb(value, sig, seq, salt);
    i.assign(value, salt, seq, pk.data(), sig.data());

    if (alerts.should_post<dht_put_alert>())
        alerts.post_alert(dht_put_alert(pk, sig, salt, seq));
}

void session_impl::dht_put_mutable_item(
    boost::array<char, 32> key,
    boost::function<void(entry&, boost::array<char,64>&,
    boost::uint64_t&, std::string const&)> cb,
    std::string salt)
{
    if (!m_dht) return;

    m_dht->put_item(key.data(), 
                    boost::bind(&put_mutable_callback, 
                                boost::ref(m_alerts), 
                                _1, 
                                cb), 
                    salt);
}

build/ folder and binaries are missing

I've noticed the build folder is gone, and also, none of the build shell scripts in the swig/ folder work. So I'm unable to get libtorrent 1.1.0.1-3 working.

How to set custom swig settings in a SettingsPack correctly?

Here's how I'm currently doing it, and I have no idea if its working or not:

session = new Session();
sessionSettings = new SettingsPack();

sessionSettings.setActiveSeeds(999999);
sessionSettings.setInteger(int_types.active_limit.swigValue(), 999999); // this line

session.applySettings(sessionSettings);

LibTorrent.version()

Under Windows it gives me this result: 1.1.0.0

I am confused because I expect a version like 1.0.7.

Is it a bug or do you work with an unstable version of libtorrent?

session.AddTorrent flags

Based on arvid's recommendations, I need to set seed_mode=true on a torrent added to the session.

I see the addTorrentParams method, but wouldn't it be better to use it like so?

TorrentHandle torrent = session.addTorrent(File torrent, File saveDir, File saveResumeData, Set<TorrentFlagEnum> flags);

If not, could you give me an example of how to set those parameters while adding a torrent with swig?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.