Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow accessing backing class for a channel instead of only its factory #859

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ public enum TransportMethod {
}

public record TransportType(TransportMethod method,
Class<? extends ServerSocketChannel> serverSocketChannelClass,
ChannelFactory<? extends ServerSocketChannel> serverSocketChannelFactory,
Class<? extends SocketChannel> socketChannelClass,
ChannelFactory<? extends SocketChannel> socketChannelFactory,
Class<? extends DatagramChannel> datagramChannelClass,
ChannelFactory<? extends DatagramChannel> datagramChannelFactory,
Function<ThreadFactory, EventLoopGroup> eventLoopGroupFactory,
boolean supportsTcpFastOpenServer,
Expand All @@ -46,8 +49,11 @@ public static TransportType determineTransportMethod() {
if (isClassAvailable("io.netty.incubator.channel.uring.IOUring") && IOUring.isAvailable()) {
return new TransportType(
TransportMethod.IO_URING,
IOUringServerSocketChannel.class,
IOUringServerSocketChannel::new,
IOUringSocketChannel.class,
IOUringSocketChannel::new,
IOUringDatagramChannel.class,
IOUringDatagramChannel::new,
factory -> new IOUringEventLoopGroup(0, factory),
IOUring.isTcpFastOpenServerSideAvailable(),
Expand All @@ -58,8 +64,11 @@ public static TransportType determineTransportMethod() {
if (isClassAvailable("io.netty.channel.epoll.Epoll") && Epoll.isAvailable()) {
return new TransportType(
TransportMethod.EPOLL,
EpollServerSocketChannel.class,
EpollServerSocketChannel::new,
EpollSocketChannel.class,
EpollSocketChannel::new,
EpollDatagramChannel.class,
EpollDatagramChannel::new,
factory -> new EpollEventLoopGroup(0, factory),
Epoll.isTcpFastOpenServerSideAvailable(),
Expand All @@ -70,8 +79,11 @@ public static TransportType determineTransportMethod() {
if (isClassAvailable("io.netty.channel.kqueue.KQueue") && KQueue.isAvailable()) {
return new TransportType(
TransportMethod.KQUEUE,
KQueueServerSocketChannel.class,
KQueueServerSocketChannel::new,
KQueueSocketChannel.class,
KQueueSocketChannel::new,
KQueueDatagramChannel.class,
KQueueDatagramChannel::new,
factory -> new KQueueEventLoopGroup(0, factory),
KQueue.isTcpFastOpenServerSideAvailable(),
Expand All @@ -81,8 +93,11 @@ public static TransportType determineTransportMethod() {

return new TransportType(
TransportMethod.NIO,
NioServerSocketChannel.class,
NioServerSocketChannel::new,
NioSocketChannel.class,
NioSocketChannel::new,
NioDatagramChannel.class,
NioDatagramChannel::new,
factory -> new NioEventLoopGroup(0, factory),
false,
Expand Down
Loading