My users are reporting this error to me, and I would like to silently ignore it, since it is a non crucial part of my application.
2013-02-09 15:20:15 [WARNING] Failed to set a channel option: [id: 0x8cf59443, /84.100.204.150:51292 => /87.98.181.225:22091]
io.netty.channel.ChannelException: java.net.SocketException: Invalid argument: no further information
at io.netty.channel.socket.DefaultSocketChannelConfig.setTrafficClass(DefaultSocketChannelConfig.java:264)
at io.netty.channel.socket.DefaultSocketChannelConfig.setOption(DefaultSocketChannelConfig.java:115)
at io.netty.bootstrap.ServerBootstrap$ServerBootstrapAcceptor.inboundBufferUpdated(ServerBootstrap.java:264)
at io.netty.channel.DefaultChannelHandlerContext.invokeInboundBufferUpdated(DefaultChannelHandlerContext.java:1170)
at io.netty.channel.DefaultChannelHandlerContext.fireInboundBufferUpdated0(DefaultChannelHandlerContext.java:1148)
at io.netty.channel.DefaultChannelHandlerContext.fireInboundBufferUpdated(DefaultChannelHandlerContext.java:1127)
at io.netty.channel.DefaultChannelPipeline.fireInboundBufferUpdated(DefaultChannelPipeline.java:903)
at io.netty.channel.socket.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:84)
at io.netty.channel.socket.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:397)
at io.netty.channel.socket.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:361)
at io.netty.channel.socket.nio.NioEventLoop.run(NioEventLoop.java:301)
at io.netty.channel.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:110)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketException: Invalid argument: no further information
at sun.nio.ch.Net.setIntOption0(Native Method)
at sun.nio.ch.Net.setSocketOption(Unknown Source)
at sun.nio.ch.SocketChannelImpl.setOption(Unknown Source)
at sun.nio.ch.SocketAdaptor.setIntOption(Unknown Source)
at sun.nio.ch.SocketAdaptor.setTrafficClass(Unknown Source)
at io.netty.channel.socket.DefaultSocketChannelConfig.setTrafficClass(DefaultSocketChannelConfig.java:262)
… 12 more
To accomplish this, I am simply setting the IP_TOS option in my ServerBootstrap:
childOption(ChannelOption.IP_TOS, 0x18)
If you know where I would need to place a handler, or option to ignore a failure in setting this option, please let me know.
md_5
Here’s an example bootstrap code that sets an option: