Stop irc and websocket writer goroutines when the connection closes
This commit is contained in:
parent
e47cb5f0e4
commit
e55760a1a5
4 changed files with 34 additions and 17 deletions
|
@ -67,6 +67,7 @@ func (s *Session) setWS(addr string, ws *websocket.Conn) {
|
|||
|
||||
func (s *Session) deleteWS(addr string) {
|
||||
s.wsLock.Lock()
|
||||
s.ws[addr].close()
|
||||
delete(s.ws, addr)
|
||||
s.wsLock.Unlock()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue