3 Replies Latest reply: Apr 25, 2012 7:51 AM by EJP RSS

    HttpURLConnection and Sockets

      Hello there,

      hope for some help here because i find no way to solve my problem:

      I´ve written my own JSSEProvider and my own socket factory - Running well. Now i want to use HttpURLConnection to handle a new request and try to handle the response. This works fine: I put my factory to the HttpURLConnection-instance and set all my preferences. Response from server is also fine!

      Now the problem: I want to send a second request to the same URL but i want to use the same socket from the HttpURLconnection before. I tried everything to hold the socket but it seems to me that i cant hold it. For every connect a new handshake is done...i do not want that! The problem is that HttpURLConnect can only handle a single request and response right?

      Getting a new HttpURLConnection.connect() always seems to call createSocket() on my Factory implementation instead of using an existing one. Anyone known a way to get HttpURLConnections on the same socket? I see no way for this until now :( :( :(

      Thx for HELP!!!