0

I'm building android communication library for my project. I have several servers which I'm contacting using REST API so for my implementation I was wondering if anyone knows, if I contact same URL but different URIS, meaning I have different REST requests for the same host for each I'll have to use URL class which creates HTTPSUrlConnection interface, in it's end I WILL call disconnect(), the question is , how efficient it is to aggregate these kind of requests together? if there's not point I won't invest time in it, but if android knows to keep the connection open for a few more seconds to see if there are any more sockets opened for that address there's a lot of point in doing this.

Anyone?

madhan kumar
  • 1,560
  • 2
  • 26
  • 36
codeScriber
  • 4,582
  • 7
  • 38
  • 62
  • never mid, if i knew how to remove this question i would, it's been asked in other words already and answered basically in android's documentation: http://developer.android.com/reference/java/net/HttpURLConnection.html – codeScriber Dec 21 '14 at 08:07
  • oh the answer is yet there is connection pooling and sockets may be held longer than needed even after disconnect was called, but for several requests to the same domain this is very efficient. – codeScriber Dec 21 '14 at 08:08

1 Answers1

-1

never mid, if i knew how to remove this question i would, it's been asked in other words already and answered basically in android's documentation: developer.android.com/reference/java/net/HttpURLConnection.h‌​tml

oh the answer is yet there is connection pooling and sockets may be held longer than needed even after disconnect was called, but for several requests to the same domain this is very efficient. – codeScriber

Armali
  • 18,255
  • 14
  • 57
  • 171