Closed RandoMan70 closed 11 months ago
Calling WriteClose immediately exits the loop and closes the connection If you don't want to send a close frame, try socket.NetConn().Close()
Are you worried that WriteClose won't make the loop exit immediately?
Thank you, NetConn().Close() works fine. I actually found that in my conditions WriteClose() does not exit loop, but I'm using custom Conn over raw sockets.
I've just committed some code that calls the underlying connection's Close method in WriteClose. You can experience this with this command:
go get -v github.com/lxzan/gws@90819f9bb947a83d073061285be6e3a54c317cd3
There's very little change, and it'll be a while before I put an official tag on it.
Something like WriteClose() but really closing connection and terminating ReadLoop?