4 ms·
Has anyone bridged this to Java with JNI and used it well for a HTTP/2 client? Considering doing this some time within the next month but if someone already has
by renewiltord 3y ago
Has anyone bridged this to Java with JNI and used it well for a HTTP/2 client? Considering doing this some time within the next month but if someone already has done work would be useful to see.
Response to below user since rate limited:
Few Java libraries support everything required. At the socket level if you want to get cmsg struct information you’re not going to get that from most Java libraries and you need that configurable since sometimes you use SO_TIMESTAMP et al. and other times you don’t and if you use SW for that you can lose a few hundred micros there.
OTOH libwebsockets very easy to modify. Downside is it manages the loop. So you need to do some engineering. But if someone has already learned the lessons there it would be helpful to me. If they haven’t, I’ll just do it I suppose.
- jansommer 3y agoNot a Java developer, but why not use an existing Java library for this? Don't know if they're using C or something else behind the scenes, but a quick Google search brings up a few.
- sumeruchat 3y agoWell because in java you wont be able to do low level stuff like managing individual memory blocks that is essential in a websockets networking lib.
- ianlevesque 3y agoThis is just false with NIO buffers. There’s a large corpus of Netty-based servers and clients for all sorts of binary protocols.
- rad_gruchalski 3y agoI wonder how other websockets libraries for java do it if it is impossible /s
- rockwotj 3y agoLook at Netty.io, that's the defecto java networking library. They have some optional JNI stuff
- deleted 3y ago[deleted]