[Twisted-Python] UDP question

jarrod roberson jarrod at vertigrated.com
Sat Jul 8 18:25:12 MDT 2006


On 7/8/06, Alec Matusis <matusis at matusis.com> wrote:
>
> >You can have as many processes listening on a single MULTICAST UDP port
> as
> you like.
>
> Well, I am trying to run this example multicast UDP server:
>
> from twisted.internet.protocol import DatagramProtocol
> from twisted.internet import reactor
> from twisted.application.internet import MulticastServer
>
> class MulticastServerUDP(DatagramProtocol):
>     def startProtocol(self):
>         print 'Started Listening'
>         # Join a specific multicast group
>         self.transport.joinGroup('225.0.0.1')
>
>     def datagramReceived(self, datagram, address):
>             self.transport.write("data",address)
>
> reactor.listenMulticast(8005, MulticastServerUDP())
> reactor.run()
>
> when I try running more that one instance of this on the same machine I
> get
>
> twisted.internet.error.CannotListenError: Couldn't listen on any:8005:
> (98,
> 'Address already in use').
>
> So my quiestion is how can I have multiple processes listening for
> multicast
> on the same machine?
>
> ________________________________
>
> quick google for "udp twisted listen multiple" reveals



def startListening(self):
        reactor.listenMulticast(5353, self, maxPacketSize=1024,
                                listenMultiple=True)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20060708/e482c624/attachment.html>


More information about the Twisted-Python mailing list