golangSocketChat icon indicating copy to clipboard operation
golangSocketChat copied to clipboard

The program have a bug

Open hzxgo opened this issue 9 years ago • 0 comments

When a WebClient connecting to Server,The map of ActiveClients have add a element(key=socketClient, value=0). But, when a WebClient closed. The element have not deleted.

func WShandler(ws *websocket.Conn) { ...... for { var reply string var clientMessage string if err = websocket.Message.Receive(ws, &reply); err != nil { log.Println("Can't receive ", socketClientIP, err.Error()) // should add begin delete(ActiveClients, socketClient) return // should add end } ...... } }

hzxgo avatar Jul 23 '15 07:07 hzxgo