Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zourb opened this issue Jul 30, 2015 · 2 comments
Closed

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

zourb opened this issue Jul 30, 2015 · 2 comments

Comments

@zourb
Copy link

zourb commented Jul 30, 2015

I got the exception when using okhttp:2.4.0.

java.net.SocketException: sendto failed: EPIPE (Broken pipe)
at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:499)
at libcore.io.IoBridge.sendto(IoBridge.java:468)
at java.net.PlainSocketImpl.write(PlainSocketImpl.java:508)
at java.net.PlainSocketImpl.access$100(PlainSocketImpl.java:46)
at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:270)
at okio.Okio$1.write(Okio.java:78)
at okio.AsyncTimeout$1.write(AsyncTimeout.java:155)
at okio.RealBufferedSink.flush(RealBufferedSink.java:221)
at com.squareup.okhttp.internal.http.HttpConnection.flush(HttpConnection.java:141)
at com.squareup.okhttp.internal.http.HttpTransport.finishRequest(HttpTransport.java:52)
at com.squareup.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:915)
at com.squareup.okhttp.internal.http.HttpEngine.access$300(HttpEngine.java:95)
at com.squareup.okhttp.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:902)
at com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:760)
at com.squareup.okhttp.Call.getResponse(Call.java:274)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:230)
at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:201)
at com.squareup.okhttp.Call.execute(Call.java:81)

at java.lang.Thread.run(Thread.java:841)
Caused by: libcore.io.ErrnoException: sendto failed: EPIPE (Broken pipe)
at libcore.io.Posix.sendtoBytes(Native Method)
at libcore.io.Posix.sendto(Posix.java:155)
at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:177)
at libcore.io.IoBridge.sendto(IoBridge.java:466)
... 22 more

@swankjesse
Copy link
Member

That's working as designed. Sometimes you lose network connectivity.

@hash070
Copy link

hash070 commented Oct 3, 2022

I've encountered this problem too. I think that is not caused by my backend's limitation. It seems to be the okhttp's post method has some problems when sending a large request body. 
I finally solved this problem by changing the post method to the put method to send my large request body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants