Stop listening for messages.

def stop(self, timeout_s=None):
    """Stop listening for messages."""
    self._live = False
    try:
      self._sock.shutdown(socket.SHUT_RDWR)
      self._sock.close()
    except socket.error:
      pass
    self.join(timeout_s)