Monday, 15 April 2013

java - Netty - Ignore failed setting of IP_TOS -



java - Netty - Ignore failed setting of IP_TOS -

my users reporting error me, , silently ignore it, since non crucial part of application.

2013-02-09 15:20:15 [warning] failed set channel option: [id: 0x8cf59443, /84.100.204.150:51292 => /87.98.181.225:22091] io.netty.channel.channelexception: java.net.socketexception: invalid argument: no farther info @ io.netty.channel.socket.defaultsocketchannelconfig.settrafficclass(defaultsocketchannelconfig.java:264) @ io.netty.channel.socket.defaultsocketchannelconfig.setoption(defaultsocketchannelconfig.java:115) @ io.netty.bootstrap.serverbootstrap$serverbootstrapacceptor.inboundbufferupdated(serverbootstrap.java:264) @ io.netty.channel.defaultchannelhandlercontext.invokeinboundbufferupdated(defaultchannelhandlercontext.java:1170) @ io.netty.channel.defaultchannelhandlercontext.fireinboundbufferupdated0(defaultchannelhandlercontext.java:1148) @ io.netty.channel.defaultchannelhandlercontext.fireinboundbufferupdated(defaultchannelhandlercontext.java:1127) @ io.netty.channel.defaultchannelpipeline.fireinboundbufferupdated(defaultchannelpipeline.java:903) @ io.netty.channel.socket.nio.abstractniomessagechannel$niomessageunsafe.read(abstractniomessagechannel.java:84) @ io.netty.channel.socket.nio.nioeventloop.processselectedkey(nioeventloop.java:397) @ io.netty.channel.socket.nio.nioeventloop.processselectedkeys(nioeventloop.java:361) @ io.netty.channel.socket.nio.nioeventloop.run(nioeventloop.java:301) @ io.netty.channel.singlethreadeventexecutor$2.run(singlethreadeventexecutor.java:110) @ java.lang.thread.run(unknown source) caused by: java.net.socketexception: invalid argument: no farther info @ sun.nio.ch.net.setintoption0(native method) @ sun.nio.ch.net.setsocketoption(unknown source) @ sun.nio.ch.socketchannelimpl.setoption(unknown source) @ sun.nio.ch.socketadaptor.setintoption(unknown source) @ sun.nio.ch.socketadaptor.settrafficclass(unknown source) @ io.netty.channel.socket.defaultsocketchannelconfig.settrafficclass(defaultsocketchannelconfig.java:262) ... 12 more

to accomplish this, setting ip_tos alternative in serverbootstrap: childoption(channeloption.ip_tos, 0x18)

if know need place handler, or alternative ignore failure in setting option, please allow me know.

md_5

here's illustration bootstrap code sets option:

bootstrap b = new bootstrap(); b.group(new nioeventloopgroup(), new nioeventloopgroup()) .channel(nioserversocketchannel.class) .option(channeloption.so_backlog, 100) .handler(new logginghandler(loglevel.info)) .childhandler(new channelinitializer<socketchannel>() { @override public void initchannel(socketchannel ch) throws exception { seek { ch.config().settrafficclass(0x18); } grab (channelexception e) { // ignore } ch.pipeline().addlast( new logginghandler(loglevel.info), new echoserverhandler()); } });

java netty

No comments:

Post a Comment