go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

RPC Client doesn't gracefully close Websocket Connections

Open moorow opened this issue 1 year ago • 4 comments

System information

Geth version: 1.14.8 OS & Version: OSX

Expected behaviour

When rpc.Client Close() is called, I would expect a message like this to be sent

err := cli.writeMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, ""))

Actual behaviour

The client closes the TCP conn without sending a WS Close message, leading to websocket: close 1006 (abnormal closure): unexpected EOF on the server side.

Steps to reproduce the behaviour

Open a WS connection with the rpc.Client. Close the connection.

moorow avatar Sep 20 '24 14:09 moorow