[Twisted-Python] Error (and response) handling in protocols

Michael Thompson michaelnt at gmail.com
Mon Feb 21 00:58:01 MST 2011


On 21 February 2011 07:00, Jason Heeris <jason.heeris at gmail.com> wrote:
> On 21 February 2011 14:50, Michael Thompson <michaelnt at gmail.com> wrote:
>> This might be better expressed as how do you write a protocol to
>> handle errors when using an unreliable transport. It down to your
>> protocol as to how you need to handle errors by for instance sending a
>> NACK  or re-transmitting a request.
>
> And what if that fails? Or times out? If this is part of a user driven
> app, shouldn't the user be notified of an error at some point? What
> I'm asking is: how do I communicate the failure of a protocol back to
> the rest of the app?

The app should be waiting on the result of a deferred (which it
expects to fire with the result of the serial comms) so you can simply
errback that deferred.




More information about the Twisted-Python mailing list