websocket icon indicating copy to clipboard operation
websocket copied to clipboard

writing on closed connection without getting error !

Open mahditakrim opened this issue 1 year ago • 0 comments

After I close the client connection, I write message on it with conn.WriteJSON() and here is what happens:

  • the first attempt to write returns just fine however the connection is closed and I expect to have error.
  • the second attempt to write returns error which is "write tcp 127.0.0.1:9090->127.0.0.1:41274: write: broken pipe"

So the question is why the very first write on a closed connection does not return error ?!

mahditakrim avatar May 29 '23 12:05 mahditakrim