Enhance transports

* Support IPv6 schema
* Add transport integration tests
* Add UNIX socket server
This commit is contained in:
Josh Wu
2025-08-18 16:12:48 +08:00
parent 3b8dd6f3cf
commit bb2aa8229d
10 changed files with 238 additions and 45 deletions

View File

@@ -77,21 +77,17 @@ async def open_android_emulator_transport(spec: Optional[str]) -> Transport:
# Parse the parameters
mode = 'host'
server_host = 'localhost'
server_port = '8554'
server_address = 'localhost:8554'
if spec:
params = spec.split(',')
for param in params:
if param.startswith('mode='):
mode = param.split('=')[1]
elif ':' in param:
server_host, server_port = param.split(':')
else:
raise TransportSpecError('invalid parameter')
server_address = param
# Connect to the gRPC server
server_address = f'{server_host}:{server_port}'
logger.debug(f'connecting to gRPC server at {server_address}')
logger.debug('connecting to gRPC server at %s', server_address)
channel = grpc.aio.insecure_channel(server_address)
service: Union[EmulatedBluetoothServiceStub, VhciForwardingServiceStub]