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