Fwd: Basic asyncio usage

Piotr Husiatyński piotrhusiatynski at gmail.com
Wed Mar 26 07:35:31 EDT 2014


Hi,
I have posted the same question to python-tutor list *, but I'm trying
my luck here as advised.

I'm trying to get more familiar with asyncio library. Using python
3.4, I wrote simple echo server (see attachement for the code). I know
that instead of using bare bone send/recv I could use some of the
helper functions, but I want to start with the basics.

Using attached code, I can connect from multiple sources, but echo
won't work for all clients. Also, please look at the `sendall` mehtod
- I have to manually remove write callback, otherwise it will be
called all the time. Any tips on solving this problem?

* https://mail.python.org/pipermail/tutor/2014-March/100679.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asynciotest.py
Type: text/x-python
Size: 2065 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20140326/6b0c693b/attachment.py>


More information about the Python-list mailing list