Hi Thierry!

I still want to use the HttpURLConnection in my application. 

Version: 2.0.3
Module: org.restlet.ext.net

I can not make the keep-alive working.
This a big problem, since the performance is massive derading espacially using 
HTTPS.

Below is my testcode. The plain HttpURLConnection is working as expected. The 
restlet requests are not keept alive.

Am I doing something wrong here?

-----------------------------------
    @Test
    public void testSSL() throws Exception {

        System.setProperty("javax.net.debug", "all");

        for (int i = 0; i < 5; i++) {
            URL url = new URL("https://www.amazon.com";);
            HttpURLConnection urlConn = (HttpURLConnection) 
url.openConnection();
            urlConn.getContent();
            urlConn.disconnect();
        }

        Context restletContext = new Context();
        restletContext.getParameters().set("maxTotalConnections", "10");
        restletContext.getParameters().set("maxConnectionsPerHost", "10");
        Client client = new Client(restletContext, Protocol.HTTPS);

        for (int i = 0; i < 5; i++) {
            ClientResource clientResource = new 
ClientResource("https://www.amazon.com";);
            clientResource.setNext(client);
            Representation representation = clientResource.get();
            String text = representation.getText();
        }
    }
------------------------------

Best regards
Klaus

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2685985

Reply via email to