FileDescriptor support improvements #237
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed writing of file descriptors (it was broken by 5e036a9)
1.1. Added a test case for it
Introducing new SPI called IFileDescriptorHelper to help convert java.io.FileDescriptor and raw int values.
2.1. Adapt org.freedesktop.dbus.FileDescriptor to use that helper.
2.2. Adapt junixsocket transport to provide a IFileDescriptorHelper with using operations from junixsocket itself (it has native impl for this)
2.3. Fallback to the old one, reflective based mode (not sure if anyone uses it, as it doesn't work on java 9+ out of box without --add-opens).
2.4. Implement hashCode/equals/toString for org.freedesktop.dbus.FileDescriptor
Added AbstractTransport.isFileDescriptorSupported() and AbstractConnection.isFileDescriptorSupported() to check if current transport/connection supports fd passing.