Skip to content
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

WebSocket connection error and SocketTimeoutException? #12

Closed
rubsnick opened this issue Jan 21, 2016 · 1 comment
Closed

WebSocket connection error and SocketTimeoutException? #12

rubsnick opened this issue Jan 21, 2016 · 1 comment

Comments

@rubsnick
Copy link

I followed a guide on how to get this completed . I'm able to receive messages but the socket keeps connecting and disconnecting, Or it'll crash if I have an onError method with an exception stating that envelope is null.

Ultimately the main issue is having socket timeout exception keeps occurring and I have no clear idea of what is going on. Here's is the stack trace with the .onError implementation.

01-21 15:15:22.392 29408-29821/com.app W/Socket: WebSocket connection error java.net.SocketTimeoutException at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488) at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37) at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237) at okio.Okio$2.read(Okio.java:139) at okio.AsyncTimeout$2.read(AsyncTimeout.java:211) at okio.RealBufferedSource.request(RealBufferedSource.java:71) at okio.RealBufferedSource.require(RealBufferedSource.java:64) at okio.RealBufferedSource.readByte(RealBufferedSource.java:77) at com.squareup.okhttp.internal.ws.WebSocketReader.readHeader(WebSocketReader.java:110) at com.squareup.okhttp.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:99) at com.squareup.okhttp.internal.ws.RealWebSocket.readMessage(RealWebSocket.java:97) at com.squareup.okhttp.ws.WebSocketCall.createWebSocket(WebSocketCall.java:153) at com.squareup.okhttp.ws.WebSocketCall.access$000(WebSocketCall.java:40) at com.squareup.okhttp.ws.WebSocketCall$1.onResponse(WebSocketCall.java:98) at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:177) at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) 01-21 15:15:22.393 29408-29821/com.app W/Socket: Failed to explicitly close following failure 01-21 15:15:22.393 29408-29821/com.app E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher Process: com.app, PID: 29408 java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.phoenixframework.channels.Envelope.getReason()' on a null object reference at org.phoenixframework.channels.Channel$5.onMessage(Channel.java:108) at org.phoenixframework.channels.Channel.trigger(Channel.java:156) at org.phoenixframework.channels.Socket.triggerChannelError(Socket.java:365) at org.phoenixframework.channels.Socket.access$1300(Socket.java:24) at org.phoenixframework.channels.Socket$PhoenixWSListener.onFailure(Socket.java:122) at com.squareup.okhttp.internal.ws.RealWebSocket.readerErrorClose(RealWebSocket.java:217) at com.squareup.okhttp.internal.ws.RealWebSocket.readMessage(RealWebSocket.java:100) at com.squareup.okhttp.ws.WebSocketCall.createWebSocket(WebSocketCall.java:153) at com.squareup.okhttp.ws.WebSocketCall.access$000(WebSocketCall.java:40) at com.squareup.okhttp.ws.WebSocketCall$1.onResponse(WebSocketCall.java:98) at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:177) at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818)

@rubsnick
Copy link
Author

It seems like this pull request fixes the issue.

@eoinsha eoinsha closed this as completed Mar 25, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants