python / asyncio

asyncio historical repository
https://docs.python.org/3/library/asyncio.html
1.04k stars 177 forks source link

Why asyncio.transport.write() function don`t send data until I use transport.close() or stop the event loop. #501

Open IcyCC opened 7 years ago

IcyCC commented 7 years ago

like this

    def data_received(self, data):

        resp = b'\x05' + struct.pack('!B', self.method)
        self.transport.write(resp)

in asyncio.Protocol