code: def run(self):
          
          while True:
              self.open_lock.acquire()
              if self.stopped():
                  return
              self.__open()
              self.open_lock.release()
docs: This override threading.Thread to open socket and wait for messages.