def __connectCentral(self, callback, failCallback): def setCentral(connection): if not self.__centralClient: # only set the client once.. the user may have sent two responses self.__centralClient = connection self.__connections.append(connection) callback() if not self.__centralClient: Client.connect(self.__settings['central server']['hostname'], self.__settings['central server']['port'], CentralClient, setCentral, failCallback) else: callback()
def __connectCentral(self, callback, failCallback): def setCentral(connection): if not self.__centralClient: # only set the client once.. the user may have sent two responses self.__centralClient = connection self.__connections.append(connection) callback() if not self.__centralClient: Client.connect( self.__settings['central server']['hostname'], self.__settings['central server']['port'], CentralClient, setCentral, failCallback ) else: callback()
def __connectPresenter(self, hostname, port, callback, failCallback): def setPresenter(connection): if not self.__presenterClient: # only set the client once.. the user may have sent two responses self.__presenterClient = connection self.__connections.append(connection) connection.setMessageListener(self.onMessage) callback() if not self.__presenterClient: Client.connect( hostname, port, PresenterClient, setPresenter, failCallback ) else: callback()