@@ -82,13 +82,12 @@ func (rc *RecConn) getConn() *websocket.Conn {
|
|||||||
// Close closes the underlying network connection without
|
// Close closes the underlying network connection without
|
||||||
// sending or waiting for a close frame.
|
// sending or waiting for a close frame.
|
||||||
func (rc *RecConn) Close() {
|
func (rc *RecConn) Close() {
|
||||||
if rc.getConn() != nil {
|
rc.mu.Lock()
|
||||||
rc.mu.Lock()
|
if rc.Conn != nil {
|
||||||
rc.Conn.Close()
|
rc.Conn.Close()
|
||||||
rc.mu.Unlock()
|
|
||||||
}
|
}
|
||||||
|
rc.isConnected = false
|
||||||
rc.setIsConnected(false)
|
rc.mu.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown gracefully closes the connection by sending the websocket.CloseMessage.
|
// Shutdown gracefully closes the connection by sending the websocket.CloseMessage.
|
||||||
|
|||||||
Reference in New Issue
Block a user