(self)
run event loop for WebSocket framework.
        This loop is infinite loop and is alive during websocket is available.
run event loop for WebSocket framework.
        This loop is infinite loop and is alive during websocket is available.
run event loop for WebSocket framework . This loop is infinite loop and is alive during websocket is available .
def run_forever(self):
        """
        run event loop for WebSocket framework.
        This loop is infinite loop and is alive during websocket is available.
        """
        if self.sock:
            raise WebSocketException("socket is already opened")
        try:
            self.sock = WebSocket(self.get_mask_key)
            self.sock.connect(self.url)
            self._run_with_no_err(self.on_open)
            while self.keep_running:
                data = self.sock.recv()
                if data is None:
                    break
                self._run_with_no_err(self.on_message, data)
        except Exception, e:
            self._run_with_no_err(self.on_error, e)
        finally:
            self.sock.close()
            self._run_with_no_err(self.on_close)
            self.sock = None
def run_forever ( self ) : if self . sock : raise WebSocketException ( "socket is already opened" ) try : self . sock = WebSocket ( self . get_mask_key ) self . sock . connect ( self . url ) self . _run_with_no_err ( self . on_open ) while self . keep_running : data = self . sock . recv ( ) if data is None : break self . _run_with_no_err ( self . on_message , data ) except Exception , e : self . _run_with_no_err ( self . on_error , e ) finally : self . sock . close ( ) self . _run_with_no_err ( self . on_close ) self . sock = None