websocket
websocket copied to clipboard
Use net.ErrClosed
Go 1.16 has introduced net.ErrClosed, which should be returned/wrapped when an I/O call is performed on a network connection which has already been closed. This is useful to avoid cluttering logs with messages like "failed to close WebSocket: already wrote close".
Closes: https://github.com/nhooyr/websocket/issues/286
Like!
Hi @nhooyr, any chance to get this reviewed? Thanks!
Ping @nhooyr, would you have the time to have a look?
Sorry for the delay I'm on a rather long sabbatical right now. Will review when I'm back by the end of this month!
Cool! No problem, take your time :)
Any news?
Hi again @nhooyr, any chance to get this reviewed?
One is missing a !.
Hi again @nhooyr, any chance to get this reviewed?
Sorry @emersion my sabbatical continues until at least mid October. Apologies for the delay and the broken promise above but I'm dealing with some personal stuff right now and was hoping to be back sooner.
I could merge this as is into master as I don't see anything wrong with it but I can't do any sort of release without dealing with #256 first which will take substantial effort. So I'd prefer to leave this PR open as is until I'm back.
Apologies for the delay and the broken promise above but I'm dealing with some personal stuff right now and was hoping to be back sooner.
No problem, thanks for having a look.
I could merge this as is into master as I don't see anything wrong with it but I can't do any sort of release without dealing with #256 first which will take substantial effort. So I'd prefer to leave this PR open as is until I'm back.
I'd personally prefer for this to be merged so that I can upgrade to the latest commit even if there's no release yet. But up to you!
Hi @nhooyr, is it possible to merge this?
Gentle ping
@nhooyr, any chance to get this merged?
Hi, any news about this?
Hm, why is that? net.Conn returns net.ErrClosed when attempting to write or close an already-closed connection.
Hm, why is that? net.Conn returns net.ErrClosed when attempting to write or close an already-closed connection.
Neither of those are closed connections, they're readers and writers for a single frame. There's only the one spot in close_notjs.go where it's correctly used when the connection is already closed.
Ah, I see, that makes sense! Fixed.
+1 to this PR :)
Can this thing go any further? Really needs it. At least the original error should be exported. 😥
Sorry for the delays, thanks @emersion