517 |
517 |
518 def flush(self): |
518 def flush(self): |
519 """ |
519 """ |
520 Public slot to flush the queue. |
520 Public slot to flush the queue. |
521 """ |
521 """ |
522 # Send commands that were waiting for the connection. |
522 if self.qsock is not None: |
523 for cmd in self.queue: |
523 # Send commands that were waiting for the connection. |
524 self.__writeJsonCommandToSocket(cmd) |
524 for cmd in self.queue: |
525 |
525 self.__writeJsonCommandToSocket(cmd) |
526 self.queue = [] |
526 |
|
527 self.queue = [] |
527 |
528 |
528 def shutdown(self): |
529 def shutdown(self): |
529 """ |
530 """ |
530 Public method to cleanly shut down. |
531 Public method to cleanly shut down. |
531 |
532 |