def close(self, blockUntilClosed = True): '''close may wait 1 second.''' Listener.close(self) if self.establish_connection_to_close_lock.acquire(False): if not blockUntilClosed: thread_start_new(self._connect_to_pipe_to_close_it, ()) else: self._connect_to_pipe_to_close_it()
def listen(self): self.startListening() self._threadId = 'running' self._threadId = thread_start_new(self.listenForConnections, ())