def METHOD_NAME(self):
    while self.connected:
        pendingdata = self.ws.recv()
        if pendingdata == '':
            self.datacallback(conapi.ConsoleEvent.Disconnect)
            return
        self.datacallback(pendingdata)