Using getAttachment from ChannelFuture

"이희승 (Trustin Lee)" trustin at gmail.com
Mon Nov 8 07:23:14 EST 2010


Hi Jason,

You could pass the ChannelHandlerContext instance when you construct a
new ChannelFutureListener and add it to the ChannelFuture.  If you are
using an anonymous class, you could simply declare a final local
variable and refer to it in your listener method.

HTH,
Trustin

jsia24 wrote:
> Hi,
> 
> I'm creating a comet server so what I did is to store the HTTPRequests in a
> concurrent hash map, however I need to track if a request timed out or
> failed due to user closing the browser or any other causes,  I implemented
> operationComplete however it passes an argument future, so when someone
> requests I should setAttachment to the http request so I can monitor later
> which connection I should remove from the hash map when it fails, how do I
> access getAttachment method from ChannelFuture?  Did I do the correct way to
> track if the HTTP connection fails (operationComplete) ?
> 
> Thanks
> Jason

-- 
Trustin Lee - http://gleamynode.net/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 290 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20101108/5dc654f6/attachment.bin 


More information about the netty-users mailing list