[issue26371] asynchat.async_chat and asyncore.dispatcher_with_send are not thread-safe

NGG report at bugs.python.org
Wed Feb 17 03:25:17 EST 2016


NGG added the comment:

If I want to write a TCP client which communicates back and forth with the server (both parties can send messages anytime) then it would be really easy to use it the following way:
Start a background thread with asyncore.loop(), and you can send messages easily, and handle_read() will be called automatically whenever data is received.
If this usage is not supported and I understand correctly then I can only send messages before starting the loop or callbacks from the loop (handle_accept, handle_read, etc).
This seems to be a much more difficult and error-prone way (at least for pre-Future python versions)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26371>
_______________________________________


More information about the Python-bugs-list mailing list