[Twisted-Python] Non-blocking UDP output?

Andrew Bennetts andrew-twisted at puzzling.org
Mon Nov 17 22:06:21 EST 2008

Peter Cai wrote:
> I know.  But write to UDP socket might fail.  And I didn't see any
> error handle code.

Here's the code in twisted/internet/udp.py that calls sendto:

                return self.socket.sendto(datagram, addr)
            except socket.error, se:
                # [snipped; a whole bunch of error handling]

> Seems that twisted amuse that calling sendto on UDP would never fail.

I don't know why you think that Twisted assumes that, as the code clearly
does expect to handle errors from sendto, including EINTR.


More information about the Twisted-Python mailing list