-
Notifications
You must be signed in to change notification settings - Fork 973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebsocketNotConnectedException #68
Comments
Umm, I don't know why this happens .. And it looks like there is no way to catch the error so far. |
It seems like it only happens to my android devices in debug mode. Thanks. |
This happens for me also. I don't have any Ack's in code, but still I get it sometimes. Don't know why.. Is there some server timeout, which is causing this disconnection all of a sudden? |
An easy way to repro this: open a socket and send a socket request once a second or so. Then pause the app in the debugger for a few minutes. When you unpause you'll hit this exception (assuming the server dropped you, which it should have (hopefully). |
@dpkirchner The websocket transport was replaced by OkHttp Websocket on v0.5.0 recently, thus this issue should not happen anymore. Can you try the latest version? |
I just tried 0.5.0 and was unable to duplicate the exception. I forgot to check if there was a newer version before making my comment. |
@dpkirchner it's ok, thanks for your report 😄 I think we can close the issue now. |
I have a weird situation here (on android device) that I don't know how to go around with it. Please help.
I can connect to the socket without any problem.
The issue i'm facing now is, after socket is connected and after I call
socket.emit("123", message, new Ack() {
@OverRide
public void call(Object... args) {
DoSomething();
}
});
It takes server a while to ack back ( around 50 seconds or so ). The moment I got the ack, the socket get disconnected, and got the following error message. Is there anyway that i could catch this exception gracefully? Thank you very much
12-04 21:39:20.041 19978-20052/AndroidRuntime﹕ FATAL EXCEPTION: EventThread
org.java_websocket.exceptions.WebsocketNotConnectedException
at org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:566)
at org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:543)
at org.java_websocket.client.WebSocketClient.send(WebSocketClient.java:171)
at com.github.nkzawa.engineio.client.transports.WebSocket$2.call(WebSocket.java:114)
at com.github.nkzawa.engineio.parser.Parser.encodePacket(Parser.java:63)
at com.github.nkzawa.engineio.parser.Parser.encodePacket(Parser.java:42)
at com.github.nkzawa.engineio.client.transports.WebSocket.write(WebSocket.java:110)
at com.github.nkzawa.engineio.client.Transport$3.run(Transport.java:98)
at com.github.nkzawa.thread.EventThread.exec(EventThread.java:50)
at com.github.nkzawa.engineio.client.Transport.send(Transport.java:94)
at com.github.nkzawa.engineio.client.Socket$7$1$1.run(Socket.java:344)
at com.github.nkzawa.engineio.client.transports.Polling$1$1.run(Polling.java:49)
at com.github.nkzawa.engineio.client.transports.Polling$1$2.call(Polling.java:64)
at com.github.nkzawa.emitter.Emitter$OnceListener.call(Emitter.java:164)
at com.github.nkzawa.emitter.Emitter.emit(Emitter.java:117)
at com.github.nkzawa.engineio.client.transports.Polling._onData(Polling.java:137)
at com.github.nkzawa.engineio.client.transports.Polling.onData(Polling.java:104)
at com.github.nkzawa.engineio.client.transports.PollingXHR$5$1.run(PollingXHR.java:113)
at com.github.nkzawa.thread.EventThread$2.run(EventThread.java:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
The text was updated successfully, but these errors were encountered: