
Nov. 23, 2013
12:38 p.m.
On 23/11/13 12:03, Maciej Wasilak wrote:
3. There is a problem with txThings IPv6 server, because in most operating systems source address of datagram is determined in round robin fashion. It may cause the source address of the response to be different than destination address of the request.
This is in general a bit of a pain with UDP apps. In Twisted, the easiest solution is to specifically bind the UDP sockets to the IP address(es) on the host, and always reply on the same protocol/transport you received on. You may find the "netifaces" package helpful for getting a list of IPs in a cross-platform manner. In theory you can avoid doing this if you have sendmsg/recvmsg support, but Twisted doesn't have this (yet).