コード例 #1
0
 async def _companion_to_target(
         self, companion: CompanionInfo) -> TargetDescription:
     channel = Channel(companion.host,
                       companion.port,
                       loop=asyncio.get_event_loop())
     stub = CompanionServiceStub(channel=channel)
     response = await stub.describe(TargetDescriptionRequest())
     channel.close()
     return target_to_py(response.target_description)
コード例 #2
0
 async def _companion_to_target(
         self, companion: CompanionInfo) -> Optional[TargetDescription]:
     try:
         channel = Channel(companion.host,
                           companion.port,
                           loop=asyncio.get_event_loop())
         stub = CompanionServiceStub(channel=channel)
         response = await stub.describe(TargetDescriptionRequest())
         channel.close()
         return target_to_py(response.target_description)
     except Exception:
         self.logger.warning(f"Failed to describe {companion}, removing it")
         self.direct_companion_manager.remove_companion(
             Address(companion.host, companion.port))
         return None
コード例 #3
0
ファイル: grpc.py プロジェクト: zeng4250538/idb
 async def describe(self) -> TargetDescription:
     async with self.get_stub() as stub:
         response = await stub.describe(TargetDescriptionRequest())
         return target_to_py(response.target_description)
コード例 #4
0
ファイル: grpc.py プロジェクト: page66688/idb
 async def describe(self) -> TargetDescription:
     response = await self.stub.describe(TargetDescriptionRequest())
     return target_to_py(response.target_description)
コード例 #5
0
async def client(client: CompanionClient) -> TargetDescription:
    response = await client.stub.describe(TargetDescriptionRequest())
    return target_to_py(response.target_description)
コード例 #6
0
async def client(client: CompanionClient) -> List[TargetDescription]:
    response = await client.stub.list_targets(ListTargetsRequest())
    return [target_to_py(target) for target in response.targets]
コード例 #7
0
ファイル: grpc.py プロジェクト: Vishalan/idb
 async def describe(self) -> TargetDescription:
     response = await self.stub.describe(TargetDescriptionRequest())
     return target_to_py(target=response.target_description,
                         companion_info=None)