I had so much trouble getting the python tcp client to work like I wanted it to. Then I tried my hand on the async tcp client and was pleasantly surprised how simple it was.
reader, writer = await asyncio.wait_for(asyncio.open_connection(), connect_timeout)
line = ""
while True:
line = await asyncio.wait_for(reader.readline(), read_timeout)
if line == b"":
break
yield line