[Twisted-Python] Getting local UDP address/port

Olivier Parisy olivier.parisy at free.fr
Sat Nov 14 10:02:50 EST 2009

I am implementing a UDP protocol where a request is sent to a server 
through a connected UDP transport.

I listen for the answer using reactor.listenUDP(0, myDatagramProtocol).

The local port is not in itself significant (hence the 0), but the 
protocol require that I get the local IP address and port of the socket 
used to send the request (so that I can properly process the answser).

How can I get this information ? datagramReceived only provides me with 
the source address and port of the answer (as can be expected).


More information about the Twisted-Python mailing list