@@ -213,26 +213,24 @@ private void createServerBootstrap(ProfileSettings profileSettings, SharedGroupF
213213 serverBootstrap .childOption (ChannelOption .TCP_NODELAY , profileSettings .tcpNoDelay );
214214 serverBootstrap .childOption (ChannelOption .SO_KEEPALIVE , profileSettings .tcpKeepAlive );
215215 if (profileSettings .tcpKeepAlive ) {
216- // Netty logs a warning if it can't set the option, so try this only on supported platforms
217- if (IOUtils .LINUX || IOUtils .MAC_OS_X ) {
218- if (profileSettings .tcpKeepIdle >= 0 ) {
219- final SocketOption <Integer > keepIdleOption = NetUtils .getTcpKeepIdleSocketOptionOrNull ();
220- if (keepIdleOption != null ) {
221- serverBootstrap .childOption (NioChannelOption .of (keepIdleOption ), profileSettings .tcpKeepIdle );
222- }
216+ // Note that Netty logs a warning if it can't set the option
217+ if (profileSettings .tcpKeepIdle >= 0 ) {
218+ final SocketOption <Integer > keepIdleOption = NetUtils .getTcpKeepIdleSocketOptionOrNull ();
219+ if (keepIdleOption != null ) {
220+ serverBootstrap .childOption (NioChannelOption .of (keepIdleOption ), profileSettings .tcpKeepIdle );
223221 }
224- if (profileSettings .tcpKeepInterval >= 0 ) {
225- final SocketOption <Integer > keepIntervalOption = NetUtils .getTcpKeepIntervalSocketOptionOrNull ();
226- if (keepIntervalOption != null ) {
227- serverBootstrap .childOption (NioChannelOption .of (keepIntervalOption ), profileSettings .tcpKeepInterval );
228- }
229-
222+ }
223+ if (profileSettings .tcpKeepInterval >= 0 ) {
224+ final SocketOption <Integer > keepIntervalOption = NetUtils .getTcpKeepIntervalSocketOptionOrNull ();
225+ if (keepIntervalOption != null ) {
226+ serverBootstrap .childOption (NioChannelOption .of (keepIntervalOption ), profileSettings .tcpKeepInterval );
230227 }
231- if (profileSettings .tcpKeepCount >= 0 ) {
232- final SocketOption <Integer > keepCountOption = NetUtils .getTcpKeepCountSocketOptionOrNull ();
233- if (keepCountOption != null ) {
234- serverBootstrap .childOption (NioChannelOption .of (keepCountOption ), profileSettings .tcpKeepCount );
235- }
228+
229+ }
230+ if (profileSettings .tcpKeepCount >= 0 ) {
231+ final SocketOption <Integer > keepCountOption = NetUtils .getTcpKeepCountSocketOptionOrNull ();
232+ if (keepCountOption != null ) {
233+ serverBootstrap .childOption (NioChannelOption .of (keepCountOption ), profileSettings .tcpKeepCount );
236234 }
237235 }
238236 }
0 commit comments