networking - Android random wireless network loss -


i have adroid app reason appear drop wireless network connection , in turn, stop things working. app works fine , quite time until random issue happens. use okhttp making http requests, mix between get/post no authentication on web service being called. requests json based. use signalr (java client github) sending out real-time messages, again works me. use portsip sdk voip calls.

so issue, logs show things working fine until appears network loss. both signalr , okhttp start fail, in onfailure event okhttp , similar event signalr. when starts fail output logs android thinks of network connection ranging ... turned on? connected? , ssid connected , odd thing android still think connected too.

other things note phone idle, screen off app running foreground service , have background service too.

i send in status message server every minute via okhttp have hoped keeps phone network alive must wrong.

i in process of trying wifi lock wifimanager.wifi_mode_full_high_perf changed using wifimanager.wifi_mode_full see if makes difference.

i have code try , force reconnect wifi doesn't seem have effect either.

i posting logs , code next hints, tips or code changes appreciated.

log extracts below:

//signalr api notices isnt right first , attempts reconnect server. upon event call check piece off code output info.

03-30 14:39:43.751 28533 2653 d signalr : reconnecting
03-30 14:39:43.751 28533 2653 d okhttp : [utilityhelper] - checkwificonnection run!
03-30 14:39:43.751 28533 2653 d okhttp : [utilityhelper.checkwificonnection] - context passed
03-30 14:39:43.751 28533 2653 d okhttp : [utilityhelper.checkwificonnection] - wifi manager not null
03-30 14:39:43.751 28533 28915 d signalr : broadcastsrstatustask() run!
03-30 14:39:43.751 28533 28915 d signalr : broadcastsrstatustask() status: reconnecting
03-30 14:39:43.756 28533 2653 d okhttp : [utilityhelper.checkwificonnection] - connectivitymanager not null
03-30 14:39:43.756 28533 2653 d okhttp : [utilityhelper.checkwificonnection] - wifi networkinfo not null
03-30 14:39:43.756 28533 2653 d okhttp : [utilityhelper.checkwificonnection] - wifi state: connected
03-30 14:39:43.756 28533 2653 d okhttp : [utilityhelper.checkwificonnection] - wifi connected [telling wifi reconnect]!!
03-30 14:39:43.756 28533 29048 d signalr : signalrchecktask run! wait 2 seconds re-test connection.
03-30 14:39:43.761 28533 3651 system.out: (httplog)-static: issbsettingenabled false
03-30 14:39:43.761 28533 3651 system.out: (httplog)-static: issbsettingenabled false


//signalr enters disconnected state when cannot recover connection. ehostunreach points towards network right??
03-30 14:40:03.806 28533 31579 d signalr : broadcastsrstatustask() status: disconnected
03-30 14:40:03.806 28533 3662 w system.err: java.net.connectexception: failed connect /192.168.0.100 (port 1234) after 15000ms: isconnected failed: ehostunreach (no route host)
03-30 14:40:03.806 28533 3662 w system.err: @ libcore.io.iobridge.isconnected(iobridge.java:234) 03-30 14:40:03.806 28533 3662 w system.err: @ libcore.io.iobridge.connecterrno(iobridge.java:171)
03-30 14:40:03.806 28533 3662 w system.err: @ libcore.io.iobridge.connect(iobridge.java:122)
03-30 14:40:03.811 28533 3662 w system.err: @ java.net.plainsocketimpl.connect(plainsocketimpl.java:183)
03-30 14:40:03.811 28533 3662 w system.err: @ java.net.plainsocketimpl.connect(plainsocketimpl.java:452)
03-30 14:40:03.811 28533 3662 w system.err: @ java.net.socket.connect(socket.java:884)
03-30 14:40:03.811 28533 3662 w system.err: @ com.android.okhttp.internal.platform.connectsocket(platform.java:117) 03-30 14:40:03.811 28533 3662 w system.err: @ com.android.okhttp.internal.http.socketconnector.connectrawsocket(socketconnector.java:434) 03-30 14:40:03.811 28533 3662 w system.err: @ com.android.okhttp.internal.http.socketconnector.connectcleartext(socketconnector.java:105) 03-30 14:40:03.811 28533 3662 w system.err: @ com.android.okhttp.connection.connect(connection.java:1331)
03-30 14:40:03.811 28533 3662 w system.err: @ com.android.okhttp.connection.connectandsetowner(connection.java:1410) 03-30 14:40:03.811 28533 3662 w system.err: @ com.android.okhttp.okhttpclient$1.connectandsetowner(okhttpclient.java:128) 03-30 14:40:03.811 28533 3662 w system.err: @ com.android.okhttp.internal.http.httpengine.nextconnection(httpengine.java:466)
//this call server once minute battery info, wifi signal etc onfailure fires when doesn't make server. if , there issue status code 200 or 500
03-30 14:40:00.796 28533 29313 d okhttp : okhttp[request.makecall] - url: 192.168.0.100:8000/carecall/clientwebservice/setclientstatus
03-30 14:40:00.796 28533 29313 d okhttp : okhttp[request.makecall] - havewifi: true
03-30 14:40:00.796 28533 29313 d okhttp : okhttp[requestutils.makecall] - run
03-30 14:40:00.796 28533 29313 d okhttp : okhttp[requestutils.makecall] - request built, adding okhttp queue
...
03-30 14:40:10.811 28533 3660 d okhttp : requestutils.creategenericcallback.onfailure run
03-30 14:40:10.811 28533 3660 d okhttp : okhttp[carecallokhttpcallback.onfailure] run
03-30 14:40:10.811 28533 3660 d okhttp : okhttp[requestutils.onfailure] message request failure.
03-30 14:40:10.811 28533 3660 d okhttp : okhttp[requestutils.onfailure] message request failure. url: http://192.168.0.100:8000/carecall/clientwebservice/setclientstatus > iscanceled: false, isexecuted: true
03-30 14:40:10.811 28533 3660 d okhttp : okhttp[requestutils.onfailure] - error: timeout


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -