hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruwan Linton <ruwan.lin...@gmail.com>
Subject Re: Closing the persisted server connections on IOReactor pause
Date Sun, 18 Apr 2010 02:30:16 GMT
Hi Oleg,

> Hi Ruwan
> You have got to be very careful here. HTTP connection objects are not
> thread safe! One can easily run into a race condition when interacting
> with connection objects from any other but an I/O dispatch thread.

I have already encountered the above issue, and had a look at the
NhttpConnection class JavaDoc and realized this.

> So, Here is the recommended way of going about this problem. You should
> signal the intention to terminate the connection by setting a special
> attribute in the session context or changing the state of the shared
> connection state object and let the connection shut down itself, when it
> is done processing the actual message.

Thanks a lot for this valuable input, I was thinking how I can proceed with
my limited knowledge on httpcore. Really appreciate this help.

> If the persistent connection is
> idle, you may need to active it by using the IOControl interface.

May be I didn't get this part, could you please tell me how to check whether
the connection is idle or not?

> http://hc.apache.org/httpcomponents-core-4.0.1/tutorial/html/nio.html#d0e1301


> Hope this helps
> Oleg
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org

Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message