0

I have a client that constantly talks to a server via http using android-annotations's RestClient.

Every time the app is open for a long time and lots of requests have been made, new http requests simply timeout with no result and no error from the server side. Closing the app and opening it up again fixes everything.

I'm not really sure but I'm guessing it has something to do with the following parameters:

HttpClient client = new HttpClient();
client.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL);
client.setMaxConnectionsPerAddress(200); // max 200 concurrent connections to every address
client.setThreadPool(new QueuedThreadPool(250)); // max 250 threads
client.setTimeout(30000); // 30 seconds timeout; if no server reply, the request expires
client.start();

So, my question is, what happens after the limit of 200 maxConnectionsPerAddress have been made? Could this be the reason my network connection hangs after too many requests? If so, can I simply increase this number or are there any performance issues in doing so?

Henrique
  • 4,921
  • 6
  • 36
  • 61
  • I don't know if it'd raise those values so much. Is it possible the HTTP requests aren't being closed properly? If they're being kept open by something they may not close cleanly. – Joe Dec 25 '12 at 01:59
  • I am also facing the same problem..! Did you find the solution? – Aswathy P Krishnan May 14 '13 at 08:56
  • Never actually found a solution to this problem, but if I recall, I think it did actually got solved when I upgraded to a newer version of RestClient. – Henrique May 15 '13 at 14:29

0 Answers0