code: def receive(self, timeout=None):
          
          log.debug('Receiving')
          if not self._socket:
              log.warn('No connection')
              return
          try:
              if timeout:
                  rv = self._socket.poll(timeout)
                  if not rv:
                      log.info('Connection timeouted')
                      return 'Quit'
  
              data = self._socket.recv_bytes()
          except Exception:
              log.error('Connection lost')
              return 'Quit'
          log.debug('Got %s' % data)
          return data.decode('utf-8')
docs: Receive data through websocket