when destructor, the WebSocket will invoke WebSocket::Delegate's onClose function, so WebSocket must be destructor before WebSocket::Delegate