This program on Jupyter notebook connect only with first websocket. What is wrong?
session1 = aiohttp.ClientSession()
session2 = aiohttp.ClientSession()
async with session1.ws_connect('host1') as ws1:
async for msg1 in ws1:
print(msg1.data)
await asyncio.sleep(5)
async with session2.ws_connect('host2') as ws2:
async for msg2 in ws2:
print(msg2.data)
await asyncio.sleep(5)