Why ReadTimeout threw instead of IdleTimeout? How to throw IdleTimeout?
Huican Ping
pinghuican at gmail.com
Wed Aug 5 18:47:01 EDT 2009
Hello Trustin,
In my client application, I have IdleStateHalder, ReadTimeoutHandler and
WriteTimeoutHandler added like below:
===========
pipeline.addLast("idle", new IdleStateHandler(timer, 0, 0, idleTimeout));
pipeline.addLast("readTimeout", new ReadTimeoutHandler(timer,
responseTimeout,
TimeUnit.SECONDS));
pipeline.addLast("writeTimeout", new WriteTimeoutHandler(timer,
sendTimeout,
TimeUnit.SECONDS));
On the Client code, after I got the last chunk, I put the channel
(connection) into a pool, and later I can re-use them.
FYI, This client didn't close the connection. And also the backend server
doesn't close the connection also.
Both of them are "ESTABLISHED" state.
if (chunk.isLast())
{
readingChunks = false;
if (keepAlive == true)
{
conn.release(); // put back the channel back into a pool.
}
After a while, I saw the exception throw, and it is ReadTimeout, but not
IdleTimeout.
Exception:
org.jboss.netty.handler.timeout.ReadTimeoutException^M
at
org.jboss.netty.handler.timeout.ReadTimeoutHandler.<clinit>(ReadTimeoutHandler.java:62)^M
at
com.acme.http.ia.ClientPipelineFactory.getPipeline(ClientPipelineFactory.java:92)^M
at
org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:226)^M
at
org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:199)^M
Questions:
1) Why it is ReadTimeout, not idleTime?
2) How can I let it throw idleTimeout?
--
View this message in context: http://n2.nabble.com/Why-ReadTimeout-threw-instead-of-IdleTimeout--How-to-throw-IdleTimeout--tp3395228p3395228.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list