net.websocket: call close event (#17300)

This commit is contained in:
starryskye 2023-02-13 05:28:41 -07:00 committed by GitHub
parent 16344cfc28
commit 2d3508c872
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 0 deletions

View file

@ -337,6 +337,7 @@ pub fn (mut ws Client) close(code int, message string) ! {
defer {
ws.shutdown_socket() or {}
ws.reset_state() or {}
ws.send_close_event(code, message)
}
ws.set_state(.closing)
// mut code32 := 0