SO_TIMEOUT in a non-blocking channel in netty

Does SO_TIMEOUT turn off a channel without blocking if the channel does not receive read / response in milliseconds of time?

bootstrap.group(workerGroup).channel(NioSocketChannel.class). .handler(channelInitializer).option(ChannelOption.SO_TIMEOUT, 100); 

Also there is an option applicable for the server channel? as:

 serverBootstrap.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class). localAddress(new InetSocketAddress(8800)).childHandler(serverChannelInitializer). option(ChannelOption.SO_TIMEOUT, 100).bind().sync(); 
+3
source share
1 answer

No. SO_TIMEOUT has an effect only for transporting an OIO socket. You should use IdleStateHandler and handle IdleStateEvent in your userEventTriggered() implementation.

+6
source

Source: https://habr.com/ru/post/1271832/


All Articles