Question

I have experimenting with netty-4-alpha, websockets (great work!) + SSL on native Android communicating with a netty server. I got it running BUT only after I made a change to how to get hold of the sun.misc.Unsafe instance in LinkedTransferQueue.

Unfortunately, the UnsafeDetectUtil class only checks if sun.misc.Unsafe can be loaded, but on Android it fails when it tries to fetch the actual Unsafe instance since (on android) it is not called "theUnsafe" but instead "THE_ONE". Once I tried with that it worked fine.

My question is if you are interested in fixing this, so netty can run on Android? I can of course fix it and send a pull request.

Two possible solutions: - Improve the UnsafeDetectUtil so it actually tries to fetch the unsafe instance before it returns true. - Change LinkedTransferQueue so it also tries with "THE_ONE" (not sure how Unsafe is implemented on Android so it might be safer to not use it there).

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top