Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SO_TIMEOUT in non blocking channel in netty

Tags:

netty

Does the SO_TIMEOUT expire the Non blocking channel , if a channel doesn't receive a read/response in timeout millis?

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

Also, is the option applicable for server channel also? like:

serverBootstrap.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class).
localAddress(new InetSocketAddress(8800)).childHandler(serverChannelInitializer).
option(ChannelOption.SO_TIMEOUT, 100).bind().sync();
like image 678
user1920845 Avatar asked Apr 06 '14 10:04

user1920845


1 Answers

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

like image 190
Norman Maurer Avatar answered Sep 26 '22 12:09

Norman Maurer