Josiah Carlson <josiahcarl...@users.sourceforge.net> added the comment:
One of the issues with using the method that Giampaolo describes, which I explained to him, is that generally if someone sends you data, you want to receive it. You can get both data and the signal that someone disconnected, in particular, with asynchat's .close_when_done() method. If you get a read signal, generally you want to try to pull more data before you close, because when you close, you can never get any pending data again. For example, if I were to use: chat.send("commit\n") chat.close_when_done() It's very likely that on even moderate latency network connections (10ms), the other end would get the close signal at the same time as the read for the "commit\n" message. But since they close before they read, they never get the "commit" message, and maybe a transaction is reverted. My primary concern is keeping the library correct. Adding attributes in the test cases don't bother me. Jean: on what platform are you experiencing the hang? Are you using trunk or 3.1? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5798> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com