-
- log.debug('about to connect %s', host)
- reader, writer = await asyncio.wait_for(
- asyncio.open_connection(server, port),
- timeout
- )
+ if server[0] in ['/', '@']:
+ log.debug('about to connect unix socket %s', server)
+ reader, writer = await asyncio.wait_for(
+ asyncio.open_unix_connection(path=server),
+ timeout
+ )
+ else:
+ log.debug('about to connect tcp socket %s:%s', *host)
+ reader, writer = await asyncio.wait_for(
+ asyncio.open_connection(server, port),
+ timeout
+ )