kohlschutter / junixsocket

Unix Domain Sockets in Java 7 and newer (AF_UNIX), AF_TIPC, AF_VSOCK, and more
Apache License 2.0
438 stars 114 forks source link

is unix domain socket abstract namespace supported? #26

Closed alexandnpu closed 4 years ago

alexandnpu commented 8 years ago

The abstract namespace requires that the address name starts with a null char.

If this is supported, how to use it in junixsocket.

Updated:

After reading your jni code and having done google search, I find that you do not have the support. The main reason is this

At this line, you use GetStringUTFChars, which returns a modified utf-8 c string, which is explained quite well in this SO.

So maybe some change should be done your C code to support the abstract namespace in unix domain socket.

kohlschuetter commented 5 years ago

Thanks for reporting!

This would be a Linux-specific feature, but certainly worth exploring. I believe we'd have to change AFUNIXSocketAddress as well, as that currently only takes a File instance.

Pull requests welcome!

kohlschuetter commented 5 years ago

Please upgrade your dependencies to junixsocket 2.2.0. We now support the abstract namespace on both Linux and Windows.

alexandnpu commented 5 years ago

@kohlschuetter , thanks for your great work! I will give 2.2.0 a try.