retrofit2 - Strange behavior with OkHttp3 getting SocketTimeoutException only when executing from GCM listener -


i had previous post thought had solved , answered, however; after more testing can certainty problem not solved. have app makes rest calls using retrofit 2 , okhttp3. when app launched calls work fine. if leave app while there 'watchdog' timer extends broadcastreceiver makes network calls fine. however; when receive gcm message via amazon's sns network calls fail sockettimeoutexception. reproducible not have isolated in test case consumption.

any assistance in getting bottom of appreciated.

here i'm using retrofit , okhttp:

compile 'com.squareup.okhttp3:okhttp:3.8.1' compile 'com.squareup.okhttp3:logging-interceptor:3.8.1' compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.retrofit2:adapter-rxjava2:2.2.0' compile "com.google.android.gms:play-services-gcm:10.2.1" 

here stack trace i'm getting failure.

java.net.sockettimeoutexception: connect timed out @ java.net.plainsocketimpl.socketconnect(native method) @ java.net.abstractplainsocketimpl.doconnect(abstractplainsocketimpl.java:334) @ java.net.abstractplainsocketimpl.connecttoaddress(abstractplainsocketimpl.java:196) @ java.net.abstractplainsocketimpl.connect(abstractplainsocketimpl.java:178) @ java.net.sockssocketimpl.connect(sockssocketimpl.java:356) @ java.net.socket.connect(socket.java:586) @ okhttp3.internal.platform.androidplatform.connectsocket(androidplatform.java:63) @ okhttp3.internal.connection.realconnection.connectsocket(realconnection.java:223) @ okhttp3.internal.connection.realconnection.connect(realconnection.java:149) @ okhttp3.internal.connection.streamallocation.findconnection(streamallocation.java:195) @ okhttp3.internal.connection.streamallocation.findhealthyconnection(streamallocation.java:121) @ okhttp3.internal.connection.streamallocation.newstream(streamallocation.java:100) @ okhttp3.internal.connection.connectinterceptor.intercept(connectinterceptor.java:42) @ okhttp3.internal.http.realinterceptorchain.proceed(realinterceptorchain.java:92) @ okhttp3.internal.http.realinterceptorchain.proceed(realinterceptorchain.java:67) @ okhttp3.internal.cache.cacheinterceptor.intercept(cacheinterceptor.java:93) @ okhttp3.internal.http.realinterceptorchain.proceed(realinterceptorchain.java:92) @ okhttp3.internal.http.realinterceptorchain.proceed(realinterceptorchain.java:67) @ okhttp3.internal.http.bridgeinterceptor.intercept(bridgeinterceptor.java:93) @ okhttp3.internal.http.realinterceptorchain.proceed(realinterceptorchain.java:92) @ okhttp3.internal.http.retryandfollowupinterceptor.intercept(retryandfollowupinterceptor.java:120) @ okhttp3.internal.http.realinterceptorchain.proceed(realinterceptorchain.java:92) @ okhttp3.internal.http.realinterceptorchain.proceed(realinterceptorchain.java:67) @ okhttp3.logging.httplogginginterceptor.intercept(httplogginginterceptor.java:211) @ okhttp3.internal.http.realinterceptorchain.proceed(realinterceptorchain.java:92) @ okhttp3.internal.http.realinterceptorchain.proceed(realinterceptorchain.java:67) @ okhttp3.realcall.getresponsewithinterceptorchain(realcall.java:185) @ okhttp3.realcall.execute(realcall.java:69) @ com.myco.myapp.mygcmlistenerservice.getregions(mygcmlistenerservice.java:365) @ com.myco.myapp.mygcmlistenerservice.onmessagereceived(mygcmlistenerservice.java:303) @ com.google.android.gms.gcm.gcmlistenerservice.zzl(unknown source) @ com.google.android.gms.gcm.gcmlistenerservice.handleintent(unknown source) @ com.google.firebase.iid.zzb$1.run(unknown source) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1133) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:607) @ java.lang.thread.run(thread.java:762) 


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -