Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into splitting-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Sep 17, 2024
2 parents e4976d9 + de6bbe5 commit 6cee7c1
Showing 1 changed file with 15 additions and 0 deletions.
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

0 comments on commit 6cee7c1

Please sign in to comment.