'Cleanly close the connection to the server.'

def close(self):

    self.closing = True
    self.is_initialized = False
    self.timer.stop()
    if (self.notifier is not None):
        self.notifier.activated.disconnect(self._on_msg_received)
        self.notifier.setEnabled(False)
        self.notifier = None
    self.request('server_quit')
    if (self.process is not None):
        self.process.waitForFinished(1000)
        self.process.close()
    self.context.destroy()
