Closed adamw closed 2 months ago
The issue happens here: https://github.com/softwaremill/sttp-shared/blob/master/ws/src/main/scala/sttp/ws/WebSocket.scala#L54
if pongOnPing
is true (which is the default), the client tries to send a frame, which then fails for JDK ws client.
[info] Cause: java.io.IOException: Output closed
[info] at java.net.http/jdk.internal.net.http.websocket.MessageEncoder.encodePong(MessageEncoder.java:301)
[info] at java.net.http/jdk.internal.net.http.websocket.TransportImpl$SendTask$1.onPong(TransportImpl.java:404)
[info] at java.net.http/jdk.internal.net.http.websocket.TransportImpl$SendTask$1.onPong(TransportImpl.java:367)
it may be in a state that allows receiving a Close
, but not sending anything. I don't know if this will happen for other clients.
When sending an automated
pong
message for an incomingping
, it might happen that the WS becomes meanwhile closed. We should catch these exceptions and ignore them, if that's the case.