@@ -54,11 +54,12 @@ public record TransportType(TransportMethod method,
54
54
55
55
@ SuppressWarnings ("deprecation" )
56
56
private static TransportType determineTransportMethod () {
57
- if (isClassAvailable ("io.netty.channel.uring.IoUring" )
58
- && IoUring .isAvailable ()
59
- && Boolean .getBoolean ("Mcpl.io_uring" )
60
- ) {
61
- return new TransportType (
57
+ if (!Boolean .getBoolean ("Mcpl.disable-native-transport" )) {
58
+ if (isClassAvailable ("io.netty.channel.uring.IoUring" )
59
+ && IoUring .isAvailable ()
60
+ && Boolean .getBoolean ("Mcpl.io_uring" )
61
+ ) {
62
+ return new TransportType (
62
63
TransportMethod .IO_URING ,
63
64
IoUringServerSocketChannel .class ,
64
65
IoUringServerSocketChannel ::new ,
@@ -69,11 +70,14 @@ private static TransportType determineTransportMethod() {
69
70
(threads , factory ) -> new MultiThreadIoEventLoopGroup (threads , factory , IoUringIoHandler .newFactory ()),
70
71
IoUring .isTcpFastOpenServerSideAvailable (),
71
72
IoUring .isTcpFastOpenClientSideAvailable ()
72
- );
73
- }
73
+ );
74
+ }
74
75
75
- if (isClassAvailable ("io.netty.channel.epoll.Epoll" ) && Epoll .isAvailable ()) {
76
- return new TransportType (
76
+ if (isClassAvailable ("io.netty.channel.epoll.Epoll" )
77
+ && Epoll .isAvailable ()
78
+ && Boolean .parseBoolean (System .getProperty ("Mcpl.epoll" , "true" ))
79
+ ) {
80
+ return new TransportType (
77
81
TransportMethod .EPOLL ,
78
82
EpollServerSocketChannel .class ,
79
83
EpollServerSocketChannel ::new ,
@@ -85,11 +89,14 @@ private static TransportType determineTransportMethod() {
85
89
new MultiThreadIoEventLoopGroup (threads , factory , EpollIoHandler .newFactory ()) : EpollEventLoopGroup ::new ,
86
90
Epoll .isTcpFastOpenServerSideAvailable (),
87
91
Epoll .isTcpFastOpenClientSideAvailable ()
88
- );
89
- }
92
+ );
93
+ }
90
94
91
- if (isClassAvailable ("io.netty.channel.kqueue.KQueue" ) && KQueue .isAvailable ()) {
92
- return new TransportType (
95
+ if (isClassAvailable ("io.netty.channel.kqueue.KQueue" )
96
+ && KQueue .isAvailable ()
97
+ && Boolean .parseBoolean (System .getProperty ("Mcpl.kqueue" , "true" ))
98
+ ) {
99
+ return new TransportType (
93
100
TransportMethod .KQUEUE ,
94
101
KQueueServerSocketChannel .class ,
95
102
KQueueServerSocketChannel ::new ,
@@ -101,7 +108,8 @@ private static TransportType determineTransportMethod() {
101
108
new MultiThreadIoEventLoopGroup (threads , factory , KQueueIoHandler .newFactory ()) : KQueueEventLoopGroup ::new ,
102
109
KQueue .isTcpFastOpenServerSideAvailable (),
103
110
KQueue .isTcpFastOpenClientSideAvailable ()
104
- );
111
+ );
112
+ }
105
113
}
106
114
107
115
return new TransportType (
0 commit comments