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

x.websocket: websocket server fix and bring back server autobahn (#8291)

This commit is contained in:
Tomas Hellström
2021-01-23 16:56:38 +01:00
committed by GitHub
parent 4065a0327a
commit 39e5f6e9df
4 changed files with 713 additions and 694 deletions

View File

@ -73,8 +73,8 @@ fn (mut s Server) handle_ping() {
mut clients_to_remove := []string{}
for s.state == .open {
time.sleep(s.ping_interval)
for _, cli in s.clients {
mut c := cli
for i, _ in s.clients {
mut c := s.clients[i]
if c.client.state == .open {
c.client.ping() or {
s.logger.debug('server-> error sending ping to client')