[Twisted-Python] How can I call internet.MulticastServer() to enable listenMultiple?
warner at lothar.com
Sun Apr 3 19:54:56 EDT 2005
>> Why are you passing a factory in? UDP and Multicast don't use factories.
> Ok what I am trying to do is make a ZeroConfService
It is worth pointing out that IP Multicast works in terms of _groups_. When
you are listening on a socket, you must specify both UDP port number and the
group id. (IPv4 groups are specified with an IP address in the "class D"
range, 224.foo.foo.foo). If you just listen on port 5353, you're listening
for packets directed at one of your node's unicast ip addresses. If you bind
it to a specified group (18.104.22.168 is probably the one you want), then you
get packets sent to that multicast group, and multiple programs on a single
host can listen on the same multicast group.
Itamar's mdns.py code in the sandbox uses the following routine (in a
DatagramProtocol subclass) to set up the receiver:
reactor.listenMulticast(5353, self, maxPacketSize=1024,
You'll probably need to do something similar.
More information about the Twisted-Python