This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author josiahcarlson
Recipients
Date 2005-12-14.06:16:48
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=341410

Not a bug.  The control for deciding how to handle an error
in a connection is defined by the instance method
handle_error().  If you would like custom error handling in
your instances, perhaps you should subclass async_chat...

import asynchat

class MyAsyncChat(asynchat.async_chat):
    error = 0
    def handle_error(self):
        self.error = 1
        asynchat.async_chat.handle_error(self)
    def push(self, data):
        self.error = 0
        asynchat.async_chat.push(self, data)
        return self.error

Also, the fact that async_chat.push() ends up trying to send
data, is, in my opinion, a misfeature in implementation. 
Under certain circumstances it can increase data throughput,
but it removes the standard asyncore.loop/poll() from the
control flow.
History
Date User Action Args
2007-08-23 14:36:28adminlinkissue1370380 messages
2007-08-23 14:36:28admincreate