You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Supun Kamburugamuva <su...@gmail.com> on 2010/02/08 09:11:10 UTC
How to log the source port from the ClientHandler
I'm looking for a way to log the source socket port for a socket connection
from a Class implementing the NHttpClientHandler. I'm interested in both
connection creation and close events.
NHttpClientHandler class receives a instance of type NHttpClientConnection.
I can cast this to HttpInetConnection and get the required information. Is
this the correct approach for logging this information?
Also when a connection is made, can I use the SessionRequestCallback
interface's completed method for logging the connection creation?
Thanks,
Supun..
--
Software Engineer, WSO2 Inc
http://wso2.org
supunk.blogspot.com
Re: How to log the source port from the ClientHandler
Posted by Supun Kamburugamuva <su...@gmail.com>.
HI Oleg,
Thanks for the quick response.
Supun.
On Mon, Feb 8, 2010 at 5:06 PM, Oleg Kalnichevski <ol...@apache.org> wrote:
> On Mon, 2010-02-08 at 13:41 +0530, Supun Kamburugamuva wrote:
> > I'm looking for a way to log the source socket port for a socket
> connection
> > from a Class implementing the NHttpClientHandler. I'm interested in both
> > connection creation and close events.
> >
> > NHttpClientHandler class receives a instance of type
> NHttpClientConnection.
> > I can cast this to HttpInetConnection and get the required information.
> Is
> > this the correct approach for logging this information?
> >
>
> Yes, it is.
>
> > Also when a connection is made, can I use the SessionRequestCallback
> > interface's completed method for logging the connection creation?
> >
>
> Yes, you can. This is precisely what SessionRequestCallback is for.
>
> Hope this helps
>
> Oleg
>
> > Thanks,
> > Supun..
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>
--
Software Engineer, WSO2 Inc
http://wso2.org
supunk.blogspot.com
Re: How to log the source port from the ClientHandler
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2010-02-08 at 13:41 +0530, Supun Kamburugamuva wrote:
> I'm looking for a way to log the source socket port for a socket connection
> from a Class implementing the NHttpClientHandler. I'm interested in both
> connection creation and close events.
>
> NHttpClientHandler class receives a instance of type NHttpClientConnection.
> I can cast this to HttpInetConnection and get the required information. Is
> this the correct approach for logging this information?
>
Yes, it is.
> Also when a connection is made, can I use the SessionRequestCallback
> interface's completed method for logging the connection creation?
>
Yes, you can. This is precisely what SessionRequestCallback is for.
Hope this helps
Oleg
> Thanks,
> Supun..
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org