Skip to content

http POST request SocketException when content is large (Android) #195

Closed

Description

@enchev

From @cime on August 20, 2015 19:11

When I try to post large JSON, with base64 encoded image I get

Error: java.net.SocketException: sendto failed: EPIPE (Broken pipe)

Examples for two contents:

  • 100142 characters - OK
  • 15048942 characters - SocketException

Copied from original issue: NativeScript/NativeScript#611

Activity

  1. self-assigned this
    on Sep 7, 2015
  2. added this to the milestone on Sep 12, 2015
  3. modified the milestones: 1.4.0, on Sep 16, 2015
  4. atanasovg commented on Sep 16, 2015

    @atanasovg
    Contributor

    We will try to use okhttp instead of our minimalistic in-house solution. Once we integrate it, the problem will hopefully disappear.

  5. atanasovg commented on Sep 22, 2015

    @atanasovg
    Contributor

    @cime While I am experimenting with okhttp, I did some research on this issue. What I suspect is the cause for it is related to this StackOverflow Question. Generally it narrows down to Android erroneously keeping alive socket connections already closed by the server.

    Could you please try adding the following header to your connection to check whether this is case:

    var promise = http.request({
            url: "your-url",
            method: "POST",
            headers: { "connection": "close" } // this forces the connection to close explicitly
        });
    
  6. removed this from the 1.4.0 milestone on Oct 6, 2015
  7. removed their assignment
    on Oct 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions