[Twisted-Python] Handling exceptions in twisted.internet.udp?
bra at fsn.hu
Mon Feb 8 14:17:57 EST 2010
exarkun at twistedmatrix.com wrote:
>> line 109, in doRead
>> data, addr = self.socket.recvfrom(self.maxPacketSize)
>> socket.error: [Errno 113] No route to host
>> I wonder what is the preferred way of achieving that the socket will be
>> write()-able and kept open regardless what ICMP or other sending or
>> receiving error occurs?
> It seems like udp.py should be handling EHOSTUNREACH (and probably
> several more errors that it also misses currently). There's already a
> `connectionRefused` callback which could be invoked to handle these
> This seems pretty related to another open ticket:
> Aside from monkey-patching the doRead method, I don't see a way for an
> application to handle this one.
Currently the page is inaccessible (TimeoutError), but that doesn't
sound good. :(
I will work around this by modifying udp.py, that's easier in this
moment than overloading half of twisted. :)
> Development has started on fixing each of these issues. The latter
> seems to even have been reviewed and is now waiting for someone to
> address the review feedback.
OK, let's hope that these will be fixed soon.
More information about the Twisted-Python