websocket close
This commit is contained in:
parent
fd60e03efd
commit
7b82725e35
@ -75,7 +75,7 @@ func NewWebScoketConn(conn net.Conn) (c *WebsocketConn) {
|
||||
}
|
||||
|
||||
func (p *WebsocketConn) Close() error {
|
||||
if atomic.LoadInt32(&p.closed) == 1 {
|
||||
if atomic.SwapInt32(&p.closed, 1) == 1 {
|
||||
return nil
|
||||
}
|
||||
close(p.wait)
|
||||
|
Loading…
Reference in New Issue
Block a user