I made many trials, and one was like this:
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
from twisted.application.internet import MulticastServer
class MulticastClientUDP(DatagramProtocol):
def startProtocol(self):
self.transport.joinGroup('233.75.215.44')
def datagramReceived(self, datagram, address):
print "Received:" + repr(datagram)
# Trying to receive from 233.75.215.44, on our dynamically allocated port
reactor.listenUDP(60044, MulticastClientUDP())
reactor.run()
But datagramReceived is never called. Am I doing something wrong?
Is there any other method that should be called so I start listening on that group?
I've also tried to use listenMulticast instead of listenUDP but then I realized this is if I need more than one application to listen/write to the multicast port and I don't need that.
pandelis