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/27 18:26:23 UTC

[jira] Updated: (HTTPCLIENT-475) Provide support for unconnected sockets

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

Roland Weber updated HTTPCLIENT-475:
------------------------------------

    Attachment: 2k6-12-27-socketfactory-1.txt

Here is a take on a new socket factory interface for HttpClient 4.x that supports unconnected sockets. It has a new method for returning an unconnected socket, and the old method gets an (optional) unconnected socket as an additional argument. That way, the timeout and local address binding stuff remains encapsulated in the factory.
This patch addresses mainly the new interface. Implementations are modified, but not necessarily pretty and definitely not tested. Since this issue is likely to affect HTTPCLIENT-602, I'll commit the patch next week unless somebody complains. We can straighten out the details later.
Considering the original problem report, this patch will not solve the issue completely. We can support unconnected sockets all right, but where does the abort() method go now that HttpMethod is gone? ;-)

cheers,
  Roland


> Provide support for unconnected sockets
> ---------------------------------------
>
>                 Key: HTTPCLIENT-475
>                 URL: http://issues.apache.org/jira/browse/HTTPCLIENT-475
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpConn
>    Affects Versions: Nightly Builds
>         Environment: Operating System: All
> Platform: PC
>            Reporter: Benjamin Chevillon
>         Assigned To: Roland Weber
>            Priority: Minor
>             Fix For: 4.0 Alpha 1
>
>         Attachments: 2k6-12-27-socketfactory-1.txt, ConnectTest.java, ConnectTest.log, MethodAbortTest.java, MethodAbortTestWithoutProxy.log, MethodAbortTestWithProxy.log
>
>
> Overview description:
> If Proxy settings are incorrect or host does not reply, the
> HttpClient.executeMethod() hangs, and HttpMethod.abort() does not stop it. Thus,
> you cannot assert that the entire application will stop immediately on demand.
> Expected Results:
> During a HttpMethod.executeMethod(), HttpMethod.abort() should cancel
> immediately the executeMethod().
> Actual Results:
> If HttpMethod.executeMethod() freezes because of Proxy bad settings or not
> responding hostname (in fact impossible to open the socket), the abort() method
> does not do anything.
> Platform:
> I tested it on Windows XP and Linux Debian with HttpClient 3.0 RC2 (but if you
> look further I point the problem and the source code of the nightly build is
> identical).
> See comments for the dialogue about the problem, and 2 Test cases. The solution
> is described at the end, but it may implies a change in the API and works only
> since Java 1.4.

-- 
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