Skip to content Skip to sidebar Skip to footer

Retrofit.retrofiterror: Sendto Failed: Epipe (broken Pipe)

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.

Solution 1:

Just to make sure that your configuration is correct

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

Solution 2:

Script might be getting stuck somewhere in the code, hence not posting the response meanwhile server would have closed the socket.

Increasing timeout values

okHttpClient = newOkHttpClient();
okHttpClient.setReadTimeout(60, TimeUnit.SECONDS);
okHttpClient.setConnectTimeout(60, TimeUnit.SECONDS);

Add this on your gradle

compile'com.squareup.okhttp:okhttp:2.0.0'   
Compile 'come.scrap.okhttp:okhttp-urlconnection:2.0.0'

Solution 3:

if not set port in retrofit helper , like this : http://172.51.65.62

retforit try to connect to : http://172.51.65.62:80

now if used any port else port number 80 , you will get this error

for fix this error change ip or address like : http://172.51.65.62:8256

Post a Comment for "Retrofit.retrofiterror: Sendto Failed: Epipe (broken Pipe)"