nowelium / socket.io-titanium

socket.io for titanium mobile
http://youtu.be/10ogNjWCpyc
Other
136 stars 34 forks source link

websockets fail in android #6

Closed jdponomarev closed 12 years ago

jdponomarev commented 12 years ago

Hi Yusuke! Thanks for the updates on this project! Right now i'm trying to implement websocket connection on Android. Everything is fine if im broadcasting messages globally, but when I do socket.broadcast.to("xxx") then I don't recieve anything on the phone. Sending messages from phone to node are always fine. In my app I'm not restricting messages to a namespace, that might be a problem, I'll test it. This problem occurs only on android, in iOS it's fine.

All the debug info I can provide is (not sure if it is related)

D/TiHttpClient( 1708): (KrollRuntimeThread) [43396,121325] Setting ready state to 1 W/TypeConverter( 1708): jsValueToJavaObject returning null D/TiHttpClient( 1708): (TiHttpClient-6) [31,121356] Setting ready state to 2 D/TiHttpClient( 1708): (TiHttpClient-6) [1,121357] Setting ready state to 3 D/TiHttpClient( 1708): (TiHttpClient-6) [2,121359] Setting ready state to 4 W/TypeConverter( 1708): jsValueToJavaObject returning null W/TypeConverter( 1708): jsValueToJavaObject returning null W/TypeConverter( 1708): jsValueToJavaObject returning null

nowelium commented 12 years ago

Thank you for report.

I'll try to check my android(Nexus one). so wait just for a moment

jdponomarev commented 12 years ago

I figured out the problem. Sometimes if the device is quite loaded the websocket connection terminates and tries to reconnect in a while. In my case I was losing messages while the device was drawing ui. So this issue is definately not related to socket.io-titanium, it is a titanium sdk ploblem. Sorry for this, closing