I have a need to use some C libraries that use a proprietary network transfer transfer protocol. So becoming proficient with JNI is in my future.
I've about exhausted my Google skills but I have learned how to pass Java Objects back and forth, I think. I've been working on a few C++ Objects and their Java counterparts.
What I'm missing, or should I say, the most obvious thing I'm missing, is an understanding of the scope of a C++ object and how to keep it across Java calls.
What I'm thinking is to create a Connection object and a BufferedReader object. There may be more than one of these active at a time. There will be a corresponding Java Object and C++ Object so the Java interface is clean and Java-like.
But, how do I give the pointer to these C++ Objects to Java so subsequent calls can refer to them? I assume if I do a new CObject of some sort that that object will live until I call it's destructor.
I would really appreciate a link to something that describes this process, or any advice how to start.
It's not what your program can do, it's what your users do with the program.