1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ws: handle close on client quit (#6776)

This commit is contained in:
Carlos Esquerdo Bernat 2020-11-08 19:36:42 +01:00 committed by GitHub
parent 3c83551dfe
commit ba366b126f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,6 +109,7 @@ pub fn (mut ws Client) listen() ? {
ws.logger.info('Starting client listener, server($ws.is_server)...')
defer {
ws.logger.info('Quit client listener, server($ws.is_server)...')
ws.close(1000, 'closed by client')
}
for ws.state == .open {
msg := ws.read_next_message() or {