-
Notifications
You must be signed in to change notification settings - Fork 387
Intermittent ConnectThread Exception #8
Comments
Additionally, I intermittently run into the following fatal exception when I force a disconnect and quickly connect the socket again. I've tried catching these two exceptions in my function containing .connect(new IOCallback{...}); without any luck. Once again, am I doing something wrong here? 05-21 16:38:06.305: W/dalvikvm(7566): threadid=33: thread exiting with uncaught exception (group=0x4001e560) |
Can you attach the corresponding output of the server? About your second post: This could be a bug. Did you create a new instance of SocketIO or reused the old one? |
Thanks for your quick response. Could you elaborate on what kind of server output you'd like? As for the second post, my app has two states: one which requires a connection to the node server and one which does not. I force hard connects and disconnects to accomplish this, please let me know if there is a better approach. When the connection is required: When the connection is unnecessary: |
socket.io prints per default some status informations to stderr, they could be usefull. It's ok to disconnect and reconnect to a server, but disconnecting/reconnecting should be done in the same thread, otherwise the state may be inconsistent. What causes the reconnect error is the mutliton pattern in socket.io-java-client. When a SocketIO client connects to the server, it first looks up if there already is a established IOConnection to the server. If so, it is reused. In that way socket.io needs only one tcp-socket for any example.com/* address. My suspiction is, that the new SocketIO instance finds an IOConnection, which state is currently disconnecting. May you recheck your issues with current master branch? - Please report if the behavior has changed. especially for your second issue. |
Just saw your new changes. I'll update my library and keep you posted on the status for the 2nd issue. Thanks a lot |
I intermittently encounter the following fatal exception after I connect to my server. I've attached the crash logs to help identify the issue. Is there something I'm doing incorrect here?
05-21 16:23:10.367: I/System.out(7412): Connection established
05-21 16:23:10.375: W/dalvikvm(7412): threadid=17: thread exiting with uncaught exception (group=0x4001e560)
05-21 16:23:10.375: E/AndroidRuntime(7412): FATAL EXCEPTION: ConnectThread
05-21 16:23:10.375: E/AndroidRuntime(7412): java.lang.IllegalStateException: TimerTask is canceled
05-21 16:23:10.375: E/AndroidRuntime(7412): at java.util.Timer.scheduleImpl(Timer.java:578)
05-21 16:23:10.375: E/AndroidRuntime(7412): at java.util.Timer.schedule(Timer.java:461)
05-21 16:23:10.375: E/AndroidRuntime(7412): at io.socket.IOConnection.resetTimeout(IOConnection.java:480)
05-21 16:23:10.375: E/AndroidRuntime(7412): at io.socket.IOConnection.transportConnected(IOConnection.java:515)
05-21 16:23:10.375: E/AndroidRuntime(7412): at io.socket.WebsocketTransport.onOpen(WebsocketTransport.java:123)
05-21 16:23:10.375: E/AndroidRuntime(7412): at de.roderick.weberknecht.WebSocketConnection.connect(WebSocketConnection.java:139)
05-21 16:23:10.375: E/AndroidRuntime(7412): at io.socket.WebsocketTransport.connect(WebsocketTransport.java:129)
05-21 16:23:10.375: E/AndroidRuntime(7412): at io.socket.IOConnection.connectTransport(IOConnection.java:332)
05-21 16:23:10.375: E/AndroidRuntime(7412): at io.socket.IOConnection.access$300(IOConnection.java:38)
05-21 16:23:10.375: E/AndroidRuntime(7412): at io.socket.IOConnection$ConnectThread.run(IOConnection.java:201)
The text was updated successfully, but these errors were encountered: