After close 1006 reconnection does not happen
vporton opened this issue · comments
mathematician commented
After abnormal closure, automatic reconnection does not happen:
2023/07/24 19:26:15 Connected to server:ws://localhost:8081/connect
2023/07/24 19:26:15 websocket read error: websocket: close 1006 (abnormal closure): unexpected EOF
2023/07/24 19:26:15 websocket read error: websocket: not connected
2023/07/24 19:26:15 websocket read error: websocket: not connected
2023/07/24 19:26:15 websocket read error: websocket: not connected
...
for _, conn := range connections {
go func(conn *recws.RecConn) {
for {
start:
_, msg, err := conn.ReadMessage()
if err != nil {
log.Println("websocket read error:", err)
continue
}
...
}
}(conn)
...
mathematician commented
I've created a test demonstrating this bug.
mathematician commented
It was a fake alarm, and error in my code, not in the library.