def _add_shell_manager(self, cinfo, wsock): itm = None self._list_semaphore.acquire() key = None try: while True: key = agent.generate_key(10) if key not in self._list: itm = ShellManager(self, cinfo, key, wsock) self._list[key] = itm break finally: self._list_semaphore.release() itm.start() return itm
def _add_desktop_manager(self, cinfo, wsock): itm = None key = None self._list_semaphore.acquire() try: while True: key = agent.generate_key(10) if key not in self._list: if self._capture_process is None: self._capture_process = CaptureProcess(self._agent_main) itm = Manager(self, cinfo, key, wsock) self._list[key]=itm break finally: self._list_semaphore.release() itm.start() return itm