<HTML><HEAD><META content="text/html; charset=UTF-8" http-equiv="Content-Type"></HEAD><BODY>OK.&nbsp; What value are you exactly setting as SO_TIMEOUT?&nbsp; By default, Netty sets SO_TIMEOUT to 1 second already.<BR>
<BR>
chudak wrote:<BR>
&gt; We aren't talking about the success rate of the deliveries...we are talking<BR>
&gt; about the client connection hanging indefinitely when it is not getting tcp<BR>
&gt; acks back from the server. We've found that in the case that we can setup<BR>
&gt; the tcp connection but the data packets are not getting through that tcp<BR>
&gt; will keep trying to retransmit every 2 minutes...and then the OS will<BR>
&gt; finally time the connection out after 15 minutes. This is much to long to<BR>
&gt; hang around with a failed connection.<BR>
&gt;<BR>
&gt; We've found that if we set the SO_TIMEOUT on the underlying socket that it<BR>
&gt; correctly times out the connection if it can't read any data after the<BR>
&gt; timeout period. We are only able to do this because we had to extend the OIO<BR>
&gt; code to be able to inject a socket factory so we can handle SSL. To solve<BR>
&gt; the above we've also had to add another wrapper around our socket factories<BR>
&gt; that injects the SO_TIMEOUT, which is just another hack. It seems like this<BR>
&gt; should be supported by the framework.<BR>
&gt;<BR>
&gt;<BR>
&gt; Trustin Lee wrote:<BR>
&gt;&gt; As far as I know, SO_TIMEOUT does not affect the success rate of packet<BR>
&gt;&gt; deliveries. It just tells how soon socket read() should return before it<BR>
&gt;&gt; receives data so that the application can do something else till the<BR>
&gt;&gt; next read() attempt.<BR>
&gt;&gt;<BR>
&gt;&gt; Netty uses SO_TIMEOUT internally to check if there is any pending<BR>
&gt;&gt; setInterestOps() request every second.<BR>
&gt;&gt;<BR>
&gt;&gt; HTH<BR>
&gt;&gt;<BR>
&gt;&gt; chudak wrote:<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; There doesn't appear to be any way to do this. We can set the connect<BR>
&gt;&gt; timeout<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; by using the options method of the client bootstrap, e.g.:<BR>
&gt;&gt;&nbsp;&nbsp; &gt;<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; bootstrap.setOption("connectTimeoutMillis", 30);<BR>
&gt;&gt;&nbsp;&nbsp; &gt;<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; We can also set other socket options, e.g.:<BR>
&gt;&gt;&nbsp;&nbsp; &gt;<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; bootstrap.setOption("tcpNoDelay", true);<BR>
&gt;&gt;&nbsp;&nbsp; &gt;<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; We are running our netty client on a mobile device and in low network<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; coverage situations where we are getting lots of packet loss,<BR>
&gt;&gt; especially<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; during the SSL handshake, the connection hangs indefinitely.<BR>
&gt;&gt;&nbsp;&nbsp; &gt;<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; Any reason this isn't supported, especially for OIO?<BR>
&gt;&gt;&nbsp;&nbsp; &gt;<BR>
&gt;&gt;&nbsp;&nbsp; &gt;<BR>
&gt;&gt;&nbsp;&nbsp; &gt;<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; --<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; View this message in context:<BR>
&gt;&gt; http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Setting-SO-TIMEOUT-on-client-socket-channel-tp6938557p6938557.html<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; Sent from the Netty User Group mailing list archive at Nabble.com.<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; _______________________________________________<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; netty-users mailing list<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; netty-users@.jboss<BR>
&gt;&gt;&nbsp;&nbsp; &gt;&nbsp; https://lists.jboss.org/mailman/listinfo/netty-users<BR>
&gt;&gt;<BR>
&gt;&gt; _______________________________________________<BR>
&gt;&gt; netty-users mailing list<BR>
&gt;&gt; netty-users@.jboss<BR>
&gt;&gt; https://lists.jboss.org/mailman/listinfo/netty-users<BR>
&gt;&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt; --<BR>
&gt; View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Setting-SO-TIMEOUT-on-client-socket-channel-tp6938557p6941181.html<BR>
&gt; Sent from the Netty User Group mailing list archive at Nabble.com.<BR>
&gt; _______________________________________________<BR>
&gt; netty-users mailing list<BR>
&gt; netty-users@lists.jboss.org<BR>
&gt; https://lists.jboss.org/mailman/listinfo/netty-users</BODY></HTML>