You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Roland Weber (JIRA)" <ji...@apache.org> on 2006/12/28 12:40:22 UTC

[jira] Updated: (HTTPCORE-21) have connections count requests

     [ http://issues.apache.org/jira/browse/HTTPCORE-21?page=all ]

Roland Weber updated HTTPCORE-21:
---------------------------------

    Attachment: 2k6-12-28-reqcnt-1.txt

Here's a take on this one. getRequestCount() is defined on the HttpClientConnection, the counter is implemented in AbstractHttpClientConnection, and gets activated in SocketHttpClientConnection. This affects only the client side and traditional blocking IO connections. The counter is optional, implementations that do not count can simply return -1.
If getRequestCount() were lifted to HttpConnection, it would also affect server side and NIO connections. I'd rather get some feedback before working on such a big patch. Same goes for test cases.

cheers,
  Roland


> have connections count requests
> -------------------------------
>
>                 Key: HTTPCORE-21
>                 URL: http://issues.apache.org/jira/browse/HTTPCORE-21
>             Project: HttpComponents Core
>          Issue Type: Wish
>          Components: HttpCore
>    Affects Versions: 4.0-alpha3
>            Reporter: Roland Weber
>         Assigned To: Roland Weber
>            Priority: Minor
>         Attachments: 2k6-12-28-reqcnt-1.txt
>
>
> It would be nice if connections would count the requests sent since they were opened. This would greatly simplify the implementation of reuse strategies like "reuse for at most 5 requests". While it is possible to count requests elsewhere, that is clumsy and error prone. For example the HttpContext is not a good place to keep the request count, since the connection may be released to and re-acquired from a connection manager, so the previously used context is lost.
> patch follows
> cheers,
>   Roland

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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