notice of dead websocket

#1

I am using the Android client and am trying to send some JSON info every 5 seconds to the server. What I’m finding out is that the info really isn’t being sent but then at some time later (varies between 5 minutes and hours) get errors:

01-23 13:52:48.420: D/de.tavendo.autobahn.WebSocketConnection(17339): worker threads stopped

01-23 13:52:48.420: D/de.tavendo.autobahn.WebSocketConnection(17339): fail connection [code = 5, reason = WebSockets internal error (java.net.SocketException: Broken pipe)

01-23 13:52:48.420: D/de.tavendo.autobahn.WebSocketReader(17339): quit

01-23 13:52:48.420: W/MessageQueue(17339): Handler{40563b20} sending message to a Handler on a dead thread

01-23 13:52:48.420: W/MessageQueue(17339): java.lang.RuntimeException: Handler{40563b20} sending message to a Handler on a dead thread

01-23 13:52:48.420: W/MessageQueue(17339): at android.os.MessageQueue.enqueueMessage(MessageQueue.java:196)

01-23 13:52:48.420: W/MessageQueue(17339): at android.os.Handler.sendMessageAtTime(Handler.java:457)

01-23 13:52:48.420: W/MessageQueue(17339): at android.os.Handler.sendMessageDelayed(Handler.java:430)

01-23 13:52:48.420: W/MessageQueue(17339): at android.os.Handler.sendMessage(Handler.java:367)

01-23 13:52:48.420: W/MessageQueue(17339): at de.tavendo.autobahn.WebSocketWriter.forward(WebSocketWriter.java:100)

01-23 13:52:48.420: W/MessageQueue(17339): at de.tavendo.autobahn.WebSocketConnection.failConnection(WebSocketConnection.java:174)

01-23 13:52:48.420: W/MessageQueue(17339): at de.tavendo.autobahn.WebSocketConnection.access$7(WebSocketConnection.java:156)

01-23 13:52:48.420: W/MessageQueue(17339): at de.tavendo.autobahn.WebSocketConnection$1.handleMessage(WebSocketConnection.java:390)

01-23 13:52:48.420: W/MessageQueue(17339): at android.os.Handler.dispatchMessage(Handler.java:99)

01-23 13:52:48.420: W/MessageQueue(17339): at android.os.Looper.loop(Looper.java:130)

01-23 13:52:48.420: W/MessageQueue(17339): at android.app.ActivityThread.main(ActivityThread.java:3806)

01-23 13:52:48.420: W/MessageQueue(17339): at java.lang.reflect.Method.invokeNative(Native Method)

01-23 13:52:48.420: W/MessageQueue(17339): at java.lang.reflect.Method.invoke(Method.java:507)

01-23 13:52:48.420: W/MessageQueue(17339): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)

01-23 13:52:48.420: W/MessageQueue(17339): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)

01-23 13:52:48.420: W/MessageQueue(17339): at dalvik.system.NativeStart.main(Native Method)

I’m wondering if there is a more effective way of knowing when to call disconnect() on the websocket and reconnecting rather than simply waiting for the error to come back?

Sorry if this isn’t clear enough. I’d be happy to explain further if necessary.

Thanks in advance.

0 Likes

#2

Just remembered; these notices pile up until something happens and then I get a whole lot of these depending on how long the connection has been gone

···

On Thursday, January 23, 2014 2:07:36 PM UTC-5, Keith Pittner wrote:

I am using the Android client and am trying to send some JSON info every 5 seconds to the server. What I’m finding out is that the info really isn’t being sent but then at some time later (varies between 5 minutes and hours) get errors:

01-23 13:52:48.420: D/de.tavendo.autobahn.WebSocketConnection(17339): worker threads stopped

01-23 13:52:48.420: D/de.tavendo.autobahn.WebSocketConnection(17339): fail connection [code = 5, reason = WebSockets internal error (java.net.SocketException: Broken pipe)

01-23 13:52:48.420: D/de.tavendo.autobahn.WebSocketReader(17339): quit

01-23 13:52:48.420: W/MessageQueue(17339): Handler{40563b20} sending message to a Handler on a dead thread

01-23 13:52:48.420: W/MessageQueue(17339): java.lang.RuntimeException: Handler{40563b20} sending message to a Handler on a dead thread

01-23 13:52:48.420: W/MessageQueue(17339): at android.os.MessageQueue.enqueueMessage(MessageQueue.java:196)

01-23 13:52:48.420: W/MessageQueue(17339): at android.os.Handler.sendMessageAtTime(Handler.java:457)

01-23 13:52:48.420: W/MessageQueue(17339): at android.os.Handler.sendMessageDelayed(Handler.java:430)

01-23 13:52:48.420: W/MessageQueue(17339): at android.os.Handler.sendMessage(Handler.java:367)

01-23 13:52:48.420: W/MessageQueue(17339): at de.tavendo.autobahn.WebSocketWriter.forward(WebSocketWriter.java:100)

01-23 13:52:48.420: W/MessageQueue(17339): at de.tavendo.autobahn.WebSocketConnection.failConnection(WebSocketConnection.java:174)

01-23 13:52:48.420: W/MessageQueue(17339): at de.tavendo.autobahn.WebSocketConnection.access$7(WebSocketConnection.java:156)

01-23 13:52:48.420: W/MessageQueue(17339): at de.tavendo.autobahn.WebSocketConnection$1.handleMessage(WebSocketConnection.java:390)

01-23 13:52:48.420: W/MessageQueue(17339): at android.os.Handler.dispatchMessage(Handler.java:99)

01-23 13:52:48.420: W/MessageQueue(17339): at android.os.Looper.loop(Looper.java:130)

01-23 13:52:48.420: W/MessageQueue(17339): at android.app.ActivityThread.main(ActivityThread.java:3806)

01-23 13:52:48.420: W/MessageQueue(17339): at java.lang.reflect.Method.invokeNative(Native Method)

01-23 13:52:48.420: W/MessageQueue(17339): at java.lang.reflect.Method.invoke(Method.java:507)

01-23 13:52:48.420: W/MessageQueue(17339): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)

01-23 13:52:48.420: W/MessageQueue(17339): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)

01-23 13:52:48.420: W/MessageQueue(17339): at dalvik.system.NativeStart.main(Native Method)

I’m wondering if there is a more effective way of knowing when to call disconnect() on the websocket and reconnecting rather than simply waiting for the error to come back?

Sorry if this isn’t clear enough. I’d be happy to explain further if necessary.

Thanks in advance.

0 Likes

#3

Not sure I understand: are you saying you don't see a _single_ message arrive at your server ever?

/Tobias

···

Am 23.01.2014 20:07, schrieb Keith Pittner:

I am using the Android client and am trying to send some JSON info every
5 seconds to the server. What I'm finding out is that the info really
isn't being sent but then at some time later (varies between 5 minutes
and hours) get errors:

0 Likes

#4

Yes.
I am using the Android Debug Manager that comes with Android Studio. With my phone plugged in, I can see everything that comes in from server and goes out to server.

So I can watch the phone send the data (a ping, more or less) to the server every five seconds and the server simply returns it (pong).

The server also broadcasts a timestamp every 30 seconds to all active websockets, so I can watch that in the Debug Manager also.

When a phone call comes in the activity stops while I am on the phone. If it is a short (<1-3 mins) phone call then after hanging up I can see the pings and pongs from server come in all at once ( a series of them). If I’m on the phone too long (maybe >5 mins) then there won’t be any more activity with or from server. This goes on until something happens, which I am trying to figure out; maybe a phone call, maybe an incoming text message. At some point later on I will see a series of all of those error messages. I think I’ve seen 40+ come in at a time. After that, it will create a new websocket connection with server and I can see the timestamps start to come in again.

I have several phones that I am monitoring this on. If the phone has an active WIFI connection then the activity isn’t lost when a call comes in; I can continue to watch the pings,pongs, and server timestamp. On the one phone that doesn’t use WIFI (WIFI turned off) but only uses the phones data plan, this is where it happens.

Did I make this clear as mud? lol

Thanks

Keith

···

On Friday, January 24, 2014 5:07:46 AM UTC-5, Tobias Oberstein wrote:

Am 23.01.2014 20:07, schrieb Keith Pittner:

I am using the Android client and am trying to send some JSON info every

5 seconds to the server. What I’m finding out is that the info really

isn’t being sent but then at some time later (varies between 5 minutes

and hours) get errors:

Not sure I understand: are you saying you don’t see a single message
arrive at your server ever?

/Tobias

0 Likes

#5

Yes.
I am using the Android Debug Manager that comes with Android Studio.
With my phone plugged in, I can see everything that comes in from server
and goes out to server.
So I can watch the phone send the data (a ping, more or less) to the
server every five seconds and the server simply returns it (pong).
The server also broadcasts a timestamp every 30 seconds to all active
websockets, so I can watch that in the Debug Manager also.

When a phone call comes in the activity stops while I am on the phone.

What exactly is the state transitioning of the activity when the call comes in and when the call ends?

Does it differ between 3g-only and 3g+wifi?

If it is a short (<1-3 mins) phone call then after hanging up I can see
the pings and pongs from server come in all at once ( a series of them).
If I'm on the phone too long (maybe >5 mins) then there won't be any
more activity with or from server. This goes on until something happens,
which I am trying to figure out; maybe a phone call, maybe an incoming
text message. At some point later on I will see a series of all of those
error messages. I think I've seen 40+ come in at a time. After that, it
will create a new websocket connection with server and I can see the
timestamps start to come in again.

This might be a general Android behavior: if a phone call comes in, suspend all other activities, but keep up the TCP connection.

When the phone call ends, resume the activity, and let it receives everything buffer on the TCP in the meantime.

Don't know.

I have several phones that I am monitoring this on. If the phone has an
active WIFI connection then the activity isn't lost when a call comes
in; I can continue to watch the pings,pongs, and server timestamp. On
the one phone that doesn't use WIFI (WIFI turned off) but only uses the
phones data plan, this is where it happens.

Did I make this clear as mud? lol

Can you monitor and compare the activity state transitioning for both situations (3G only vs 3G + WebSocket on Wifi) when a phone call comes in?

/Tobias

···

Am 24.01.2014 13:00, schrieb Keith Pittner:

Thanks
Keith

On Friday, January 24, 2014 5:07:46 AM UTC-5, Tobias Oberstein wrote:

    Am 23.01.2014 20:07, schrieb Keith Pittner:
     > I am using the Android client and am trying to send some JSON
    info every
     > 5 seconds to the server. What I'm finding out is that the info
    really
     > isn't being sent but then at some time later (varies between 5
    minutes
     > and hours) get errors:

    Not sure I understand: are you saying you don't see a _single_ message
    arrive at your server ever?

    /Tobias

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Likes