本文介绍了retrofit.RetrofitError: sendto failed: EPIPE (Broken pipe)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 android 中为我的 RESTclient 使用 Retrofit 1.9.0,它得到如下错误:

I'm using Retrofit 1.9.0 for my RESTclient in android, It get error like i post below:

retrofit.RetrofitError: sendto failed: EPIPE (Broken pipe)
04-03 20:18:51.995 8634-8634/up.tech.opener W/System.err:     at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:395)
04-03 20:18:51.995 8634-8634/up.tech.opener W/System.err:     at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
04-03 20:18:51.995 8634-8634/up.tech.opener W/System.err:     at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
04-03 20:18:51.995 8634-8634/up.tech.opener W/System.err:     at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
04-03 20:18:51.995 8634-8634/up.tech.opener W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
04-03 20:18:51.996 8634-8634/up.tech.opener W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
04-03 20:18:51.996 8634-8634/up.tech.opener W/System.err:     at retrofit.Platform$Android$2$1.run(Platform.java:142)
04-03 20:18:51.996 8634-8634/up.tech.opener W/System.err:     at java.lang.Thread.run(Thread.java:838)
04-03 20:18:51.996 8634-8634/up.tech.opener W/System.err: Caused by: java.net.SocketException: sendto failed: EPIPE (Broken pipe)
04-03 20:18:51.997 8634-8634/up.tech.opener W/System.err:     at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:550)
04-03 20:18:51.997 8634-8634/up.tech.opener W/System.err:     at libcore.io.IoBridge.sendto(IoBridge.java:519)
04-03 20:18:51.998 8634-8634/up.tech.opener W/System.err:     at java.net.PlainSocketImpl.write(PlainSocketImpl.java:511)
04-03 20:18:51.998 8634-8634/up.tech.opener W/System.err:     at java.net.PlainSocketImpl.access$100(PlainSocketImpl.java:46)
04-03 20:18:51.998 8634-8634/up.tech.opener W/System.err:     at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:269)
04-03 20:18:51.998 8634-8634/up.tech.opener W/System.err:     at java.io.OutputStream.write(OutputStream.java:82)
04-03 20:18:51.998 8634-8634/up.tech.opener W/System.err:     at libcore.net.http.HttpEngine.writeRequestHeaders(HttpEngine.java:659)
04-03 20:18:51.998 8634-8634/up.tech.opener W/System.err:     at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:808)
04-03 20:18:51.998 8634-8634/up.tech.opener W/System.err:     at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:293)
04-03 20:18:51.998 8634-8634/up.tech.opener W/System.err:     at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:505)
04-03 20:18:51.998 8634-8634/up.tech.opener W/System.err:     at retrofit.client.UrlConnectionClient.readResponse(UrlConnectionClient.java:73)
04-03 20:18:51.999 8634-8634/up.tech.opener W/System.err:     at retrofit.client.UrlConnectionClient.execute(UrlConnectionClient.java:38)
04-03 20:18:51.999 8634-8634/up.tech.opener W/System.err:     at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:326)
04-03 20:18:51.999 8634-8634/up.tech.opener W/System.err:   ... 7 more

谁能知道如何解决这个问题?

Can anyone know how to fixing this please?

推荐答案

只是为了确保您的配置正确

Just to make sure that your configuration is correct

检查您是否已将所有必需的权限添加到您的 AndroidManifest.xml(EPIPE 经常由于缺少权限而发生)

check if you have added all the required permissions to your AndroidManifest.xml (EPIPE happens often as a result of missing permissions)

这篇关于retrofit.RetrofitError: sendto failed: EPIPE (Broken pipe)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 03:11