Add support for Unix domain datagram sockets when using native epoll/kqueue transport#11423
Conversation
|
Here are some notes for the current implementation:
|
chrisvest
left a comment
There was a problem hiding this comment.
Had some random comments from a quick glance. Haven't done a full review.
|
@violetagg can you please rebase ? |
|
The build on Windows failed with the one below, I'm not sure how this is related to this change |
|
@violetagg yeah the test-failure was observed before... trying to reproduce it as well |
normanmaurer
left a comment
There was a problem hiding this comment.
I think this is mostly fine... Just a few comments
|
Yes
… Am 08.07.2021 um 14:43 schrieb Violeta Georgieva ***@***.***>:
@violetagg commented on this pull request.
In transport-native-kqueue/src/main/java/io/netty/channel/kqueue/KQueueDomainDatagramChannel.java:
> +import io.netty.channel.unix.DomainDatagramSocketAddress;
+import io.netty.channel.unix.DomainSocketAddress;
+import io.netty.channel.unix.IovArray;
+import io.netty.channel.unix.PeerCredentials;
+import io.netty.channel.unix.UnixChannelUtil;
+import io.netty.util.CharsetUtil;
+import io.netty.util.UncheckedBooleanSupplier;
+import io.netty.util.internal.StringUtil;
+
+import java.io.IOException;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+
+import static io.netty.channel.kqueue.BsdSocket.newSocketDomainDgram;
+
+public final class KQueueDomainDatagramChannel extends AbstractKQueueDatagramChannel implements DomainDatagramChannel {
@normanmaurer This @UnstableApi should apply also to the corresponding EpollDomainDatagramChannel and EpollDomainDatagramChannelConfig ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
@violetagg can you rebase this one ? |
…datagram sockets All interfaces/classes are in transport-native-unix-common module in order to be available for KQueue and Epoll impl
Motivation: Move INET related test in a separate test class, with that change DatagramUnicastTest can be used for testing also Unix domain datagram sockets. Modifications: - Move DatagramUnicastTest#testBindWithPortOnly to DatagramUnicastInetTest. - Adapt DatagramUnicastIPv6Test, EpollDatagramUnicastTest and KQueueDatagramUnicastTest to inherit the new test class. - testBindWithPortOnly(Bootstrap, Bootstrap) method tests only with the second parameter - remove from the signature the first parameter. Make the method private and static. Result: DatagramUnicastTest can be used for testing also Unix domain datagram sockets.
…Unix domain datagram sockets.
Make DatagramUnicastTest an abstract class
According to https://man7.org/linux/man-pages/man7/unix.7.html SO_RCVBUF option does not effect for UNIX domain sockets "The SO_SNDBUF socket option does have an effect for UNIX domain sockets, but the SO_RCVBUF option does not."
Make the helper test methods private
ok, rebased |
|
I went over the PR and it seems good to me. Didn't have enough time to review every single line, though. One concern is we have quite a bit of duplication across the channel implementation such as spinning I/O, but that's probably something that has to be handled in other place. |
|
@trustin yeah I think this is something to fix later on. |
I refrained from doing a big refactoring because it would complicate the review process |
|
@violetagg thanks a lot! |
|
@chrisvest @trustin @normanmaurer Thank you very much! 🎉 🚀 |
|
@violetagg I tried to port this over to master but I have some failing tests... Not sure yet why :/ |
Should I try? |
|
Yes please
… Am 09.07.2021 um 16:43 schrieb Violeta Georgieva ***@***.***>:
@violetagg I tried to port this over to master but I have some failing tests... Not sure yet why :/
Should I try?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
ok let me give it a try |
|
@normanmaurer I opened this PR #11476 |
…kqueue transport (netty#11423) Motivation: There are use cases when Unix domain datagram sockets are needed for communication. This PR adds such support for Epoll/KQueue. Modification: - Expose Channel, Config and Packet interfaces/classes for Unix domain datagram sockets. All interfaces/classes are in `transport-native-unix-common` module in order to be available for KQueue and Epoll implementations - Add JNI code for Unix domain datagram sockets - Refactor `DatagramUnicastTest` so that it can be used for testing also Unix domain datagram sockets - Add Unix domain datagram sockets implementation for KQueue transport - Add Unix domain datagram sockets implementation for Epoll transport Result: Fixes netty#6737
Motivation:
There are use cases when Unix domain datagram sockets are needed for communication. This PR adds such support for Epoll/KQueue.
Modification:
transport-native-unix-commonmodule in order to be available for KQueue and Epoll implementationsDatagramUnicastTestso that it can be used for testing also Unix domain datagram socketsResult:
Fixes #6737