hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: HttpCore-NIO Logging
Date Thu, 07 Jul 2011 22:17:41 GMT
On Thu, 2011-07-07 at 15:14 -0400, Bill Speirs wrote:
> Does HttpCore-NIO not have any debug logging statements in it? I couldn't
> find any in my grepping through the source, or a dependency in the project's
> pom.xml. Why?
> 

Hi Bill

Different people tend to prefer different logging frameworks and there
is no way to make everyone happy. One can still add logging support
relatively easy by using logging classes from the contrib package:

http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/httpcore-contrib/src/main/java/org/apache/http/contrib/logging/

You would need to implement a custom IOEventDispatch in order to use
custom HTTP connection class instead of the default one.


> I've written a server using HttpCore-NIO and the
> BufferingHttpServiceHandler, following the example from NHttpServer.java.
> When I test my server with 10 concurrent connections making 10 total
> requests (ab -c 10 -n 10) all of the connections timeout, but wait
> CoreConnectionPNames.SO_TIMEOUT before doing so. Why would all of the
> connections timeout? What makes a connection timeout after handling the
> request?
> 

Connection timeouts are perfectly normal. It is a common practice to
close persistent connection if they stay idle over a period of time
(defined by the CoreConnectionPNames.SO_TIMEOUT in case of HttpCore).


> The biggest difference between my server and the one in the example is that
> my server is currently NOT modifying the HttpResponse in any way before
> returning from the handle method. Is this an error?

No, it is not.

>  Is this what's causing
> the timeout?
> 

I do not think so. You can disable socket timeouts altogether by setting
the value of CoreConnectionPNames.SO_TIMEOUT to zero.

Hope this helps

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message