How to raise ReadTiemoutException when not receive the response in 2 seconds after sending the request to Server

Binh Duong binhduongthanh at yahoo.com
Thu May 13 07:48:45 EDT 2010


I am trying use the example of PingPong from
http://community.jboss.org/wiki/NettyExampleofPingPongusingObject for my
scenario. I have updated the sendPingTraffic(channel) method to add the
ReadTimeoutHandler and updated the messageReceived() and exceptionCaught()
to remove the ReadTimeoutHandler but when I do that the ReadTimeoutException
does not raised. Then I tried to update the PingSerializeClient to add the
ReadTimeoutHandler (bootstrap.getPipeline().addFirst("timeout", new
ReadTimeoutHandler(timer, READ_TIMEOUT));). This time the
ReadTimeoutException is raised but I can not send another message due to the
channel is suspended(Channel.OP_WRITE = 4) and I the channelClosed() is
called.

Could you tell me what’s wrong I did?

Thanks so much,

Binh

-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/How-to-raise-ReadTiemoutException-when-not-receive-the-response-in-2-seconds-after-sending-the-requer-tp5040649p5045713.html
Sent from the Netty User Group mailing list archive at Nabble.com.



More information about the netty-users mailing list