Uploaded image for project: 'Spring for Android'
  1. Spring for Android
  2. ANDROID-72

Disable HttpURLConnection connection reuse on versions older than Froyo (Android 2.2)

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 1.0.0.M4
    • Fix Version/s: 1.0.0.RC1
    • Component/s: rest-template
    • Labels:
      None

      Description

      From http://android-developers.blogspot.com/2011/09/androids-http-clients.html

      Prior to Froyo, HttpURLConnection had some frustrating bugs. In particular, calling close() on a readable InputStream could poison the connection pool.

      private void disableConnectionReuseIfNecessary() {
      // HTTP connection reuse which was buggy pre-froyo
      if (Integer.parseInt(Build.VERSION.SDK) < Build.VERSION_CODES.FROYO)

      { System.setProperty("http.keepAlive", "false"); }

      }

        Attachments

          Activity

            People

            • Assignee:
              rclarkson Roy Clarkson
              Reporter:
              rclarkson Roy Clarkson
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: