3

I utilize Jetty (9.4.1) websocket for 2 ways communication between client and server.

  • On Client side, the messages 'onerror' and 'onclose' of WebSocket are listened, so that when there is a problem, the client will make a new connection.
  • On Server side, the 'OnError' and 'OnClose' messages also handled.

Then, sometimes I see server got an 'org.eclipse.jetty.io.EofException', 'OnError' and 'OnClose' of ServerEndpoint are invoked. But on the Client side, there is no 'onerror' or 'onclose' message is sent.
Therefore, in this case the Client is not aware of the websocket connection is closed already, still use that connection.

My questions are:
1. How can this EofException happen?
2. When this error happen, is the connection actually close or still open? Because I cannot duplicate this error programmatically, I cannot investigate to understand clearly.
3. How can I make Client aware of this exception, so that Client can reconnect and function properly?

Khoa Bui
  • 733
  • 1
  • 7
  • 15
  • I have been facing the same issue as well, have you found a solution for this? – Jeremy Apr 04 '18 at 11:46
  • 1
    I had the same error. Not sure if it was triggered in the same context as yours, and only mobile users managed to trigger that error. I think it was fixed in jetty 9.4.16(in jetty 9.4.15 the error still pop from time to time) – Doua Beri Apr 19 '19 at 00:45

0 Answers0