                 
                 if let message = newMessage {
                     Logger.debug(type: .webSocketChannel, message: "call onReceive")
-                    self.channel.internalHandlers.onReceive?(message)
-                    self.channel.handlers.onReceive?(message)
+                    weakSelf.channel.internalHandlers.onReceive?(message)
+                    weakSelf.channel.handlers.onReceive?(message)
                 } else {
                     Logger.debug(type: .webSocketChannel,
                               message: "received message is not string or binary (discarded)")
                     // discard
                 }
                 
-                self.receive()
+                weakSelf.receive()
                 
             case .failure(let error):
                 Logger.debug(type: .webSocketChannel,
                              message: "failed to receive error => \(error.localizedDescription)")
-                self.disconnect(error: error)
+                weakSelf.disconnect(error: error)
             }
         }
     }

            Logger.debug(type: .webSocketChannel, message: "\(data)")
            naviveMessage = .data(data)
        }
        webSocketTask!.send(naviveMessage) { error in
            if let error = error {
                Logger.debug(type: .webSocketChannel, message: "failed to send message")
                self.disconnect(error: error)
            }
        }
    }
    
    func receive() {
        webSocketTask?.receive { result in
            switch result {
            case .success(let message):
                Logger.debug(type: .webSocketChannel, message: "receive message => \(message)")

            
            state = .disconnecting
            webSocketTask?.cancel(with: .normalClosure, reason: nil)
            urlSession?.finishTasksAndInvalidate()
            state = .disconnected
            
            Logger.debug(type: .webSocketChannel, message: "call onDisconnect")
