-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem: JNI binding generator can't handle function pointers as method parameters #776
Comments
It looks to me as though this is also a problem with ZLoop. |
I'm not an expert in any of the tech involved here. I think one valid approach would be:
I took a first pass at this approach (and started pointing out the places that look obviously broken) here: I probably won't get another chance to look at this until next weekend, at the earliest. Maybe someone who's more familiar with GSL can help push it further along? |
Thanks for investigating I'll give it at try next week |
Thank you! |
@jimrthy I havn't forgotten this issue but I'm a bit short on time for time being. |
I haven't forgotten either. Just also distracted by other things. |
Could you take a look on https://github.com/diorcety/zproject/tree/x_java2 ? |
python use ffi in order to handle the callbacks. I used jffi which is an Java implementation which allow to use java callback quickly. This is almost the same thing that python stuff |
Neat, I'll have a look at it later, thanks
Am 12.02.2018 3:55 nachm. schrieb "Diorcet Yann" <[email protected]>:
… python use ffi in order to handle the callbacks. I used jffi which is an
Java implementation which allow to use java callback quickly. This is
almost the same thing that python stuff
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#776 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAeGuiJ5IfS-49StUlazgLunPsbrx5Xbks5tUFDlgaJpZM4LY7dS>
.
|
I managed to write a pure java class for zactor, and doing this I also discovered zsys::create_pipe was not working for the same reason, it pass a pointer to a handle. |
Found this link, but unable to see if really useful or not: (my 2 cents). |
This problem really questions the usage of JNI for this project. Is it only here for historical reasons? Can more modern solutions allow us to build sturdier bindings for Java? As of today, there are 4 ways to call C code from Java code:
More info: https://developer.okta.com/blog/2022/04/08/state-of-ffi-java#java-native-interface-jni For now, I'm toying around with JNA. Function pointers as parameters are easy to use. What else should I try? What functions of zmq have limited usage in Java atm? |
https://github.com/zeromq/zproject/blob/master/zproject_java_lib.gsl#L156
So the class is skipped given the constructor can't be generated.
This is a problem in CZMQ since it means that zactor bindings can't be generated. We'd need some help here from JNI experts! How can we fix this?
zeromq/czmq#1443
The text was updated successfully, but these errors were encountered: