EOFException on websocket
See original GitHub issueAfter connecting to webservice every single minute (seems like some ping) I’m getting the below exception (which forces me to reconnect).
java.io.EOFException
at okio.RealBufferedSource.require(RealBufferedSource.java:59)
at okio.RealBufferedSource.readByte(RealBufferedSource.java:72)
at okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.java:113)
at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:97)
at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.java:261)
at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:200)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Tomcat: EOFException when trying to reconnect via Websockets
I have a problem using ktor websockets, I had two different client types: Android: The connection to websocket it's ok, I can send...
Read more >java.io.EOFException when using WebSocket - Google Groups
Hi all,. I'm using server-to-server WebSocket connections to link clients to a cometd event pipeline. All goes well for a while, but the...
Read more >[Solved]-Spring websocket EOFException-Springboot
I was getting mysterious EOFExceptions when user sessions ended, and my solution was to beef up error handling (use a more detailed onError...
Read more >Intermittent connection to? - Dremio Community
server.socket.SocketServlet - Failure in web socket handling. java.io.EOFException: Disconnected at org.eclipse.jetty.websocket.common.
Read more >Spring-boot – Spring websocket EOFException - iTecNote
Yup, i solved it. This exception will happen after client or server was interrupted or stopped without calling close socket method(maybe lost internet,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@swankjesse you were right, after 60s of inactivity the server was closing the socket. The solution for this is of course setting a ping interval on
OkHttpClient
:@swankjesse I have the same problem as @roman-upnext but at the time to close the socket. I trigger the close method
webSocket.close(1000, null);
as in WebSocketEcho example and I always receive back the EOFException through onFailure method from listenerpublic void onFailure(WebSocket webSocket, Throwable t, Response response)
Exception: