Skip to content

Commit

Permalink
Issue #230: Disable file descriptor support in native-transport (not …
Browse files Browse the repository at this point in the history
…supported by Java native implementation, see JEP-380)
  • Loading branch information
hypfvieh committed Sep 4, 2023
1 parent b008f89 commit 43d0e86
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class NativeUnixSocketTransport extends AbstractUnixTransport {

@Override
protected boolean hasFileDescriptorSupport() {
return true; // file descriptor passing allowed when using UNIX_SOCK
return false; // See JEP-380: File descriptor not supported by native implementation (yet)
}

/**
Expand Down

2 comments on commit 43d0e86

@Flowdalic
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused, JEP-380 was delivered with Java 16. So Java native support is available on modern Java, no?

@hypfvieh
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Native unixsockets are still supported when using Java 16+, but FileDescriptor usage will not work as the Java unix socket implementation does not support this feature.
The native JVM unix socket implementation only supports what is available on any JVM platform. This is the reason why e.g. abstract unixsockets are also not support because this is a Linux only feature and does not work on Windows. Same for socket pairs.
The JEP also says that they may implement more features in the future, but I'm currently not aware of any plans on extending the native unix socket implementation.

The purpose of change here is to show proper errors when trying to use FileDescriptors in combination with native transport implementation.

Please sign in to comment.