[Twisted-Python] Multicast Server and Client Question
Hello, I am new to twisted and python and most of experience is in ksh and perl. I am trying to write a multicast client and server application. I am not sure if this is working since I can't find a way to write to a multicast group. This is what I have for the listener: from twisted.internet.protocol import DatagramProtocol from twisted.internet.udp import MulticastMixin from twisted.internet import reactor class EchoMulticast(DatagramProtocol): def datagramReceived(self, datagram, address): self.transport.write(datagram,address) def main(): reactor.listenMulticast(7774, EchoMulticast(), "224.7.7.74") reactor.run() if __name__== '__main__': main() Unfortunately, there is no connectMulticast class. How would I write to a Multicast group? Would I do a join to a Multicast group and write UDP packets? The connectUDP does not allow me to write to a multicast network and port. Thanks, Sonny <FONT SIZE = 1>**************************************************************************** This e-mail and any attachments may contain confidential and privileged information. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal. Unless otherwise stated, opinions expressed in this e-mail are those of the author and are not endorsed by the author's employer.</FONT>
On Tue, 8 Jun 2004 14:41:54 -0400, "Baillargeon, Sonny"
Unfortunately, there is no connectMulticast class. How would I write to a Multicast group? Would I do a join to a Multicast group and write UDP packets? The connectUDP does not allow me to write to a multicast network and port.
did you try .write() on the return value of .listenMulticast? When I was doing multicast stuff I basically did this: reactor.listenUDP(0, Request()).write('broadcast\n', ('224.0.0.1', 9120)) Stephen.
On Tue, 2004-06-08 at 23:04, stephen@thorne.id.au wrote:
did you try .write() on the return value of .listenMulticast? When I was doing multicast stuff I basically did this:
reactor.listenUDP(0, Request()).write('broadcast\n', ('224.0.0.1', 9120))
EEeeeeeeeeew. The fact that even works is not guaranteed. What you do is, in the protocol, self.transport.write(yourdata, ('244.0.0.1', 9120)), where the ip, port pair is the one you joined for multicasting. -- Itamar Shtull-Trauring http://itamarst.org
participants (3)
-
Baillargeon, Sonny
-
Itamar Shtull-Trauring
-
stephen@thorne.id.au