Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def make_rpc_pair(self):
port = find_unused_port()
@asyncio.coroutine
def create():
server = yield from aiozmq.rpc.serve_rpc(
MyHandler(),
bind='tcp://127.0.0.1:{}'.format(port),
loop=self.loop)
client = yield from aiozmq.rpc.connect_rpc(
connect='tcp://127.0.0.1:{}'.format(port),
loop=self.loop)
return client, server
self.client, self.server = self.loop.run_until_complete(create())
return self.client, self.server