Asyncio sockets reader returns empty bytes
<p>I'm trying to write a simple crawler. But trying to read the response from the server returns the answer only the first time. Then the reader stops reading bytes and returns b''.
I tried to put a timeout and use drain() after writing. It has not produced results. Wireshark shows that the answers come from the server, but my program does not see them.</p>

<pre><code>import asyncio

HOST = '93.184.216.34'
PORT = 80
CONCURRENT_CONNECTIONS = 3

request = 'GET / HTTP/1.1\r\n' \
          'Host: example.com\r\n' \
          'Content-Type: application/x-www-form-urlencoded\r\n' \
          '\r\n'.encode()


async def smart_read(reader):
    buffer = b''
    while True:
        response = await reader.read(1024)
        if not response:
            break
        buffer += response
    return buffer


async def work(host, port, request):
    reader, writer = await asyncio.open_connection(host, port)
    while True:
        writer.write(request)
        resp = await smart_read(reader)
        print(resp)


tasks = []
for _ in range(CONCURRENT_CONNECTIONS):
    tasks.append(asyncio.ensure_future(work(HOST, PORT, request)))

loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.wait(tasks))
loop.close()
</code></pre>