[Twisted-Python] multicast
I'm trying to make a Multicast client. I've tried the simple script found in: http://twistedmatrix.com/documents/10.1.0/core/howto/udp.html#auto3 While it shows no errors, it doesn't receive any data. How can I check what the problem is? It runs on a Debian 64-bit machine where I've installed Python2.6 and Twisted 10.0.2.0 Could it be some firewall setting? Is it possible I've somehow screwed with the installation procedure? Pandelis from twisted.internet.protocol import DatagramProtocol from twisted.internet import reactor from twisted.application.internet import MulticastServer class MulticastClientUDP(DatagramProtocol): def datagramReceived(self, datagram, address): print "Received:" + repr(datagram) # Send multicast on 224.0.0.1:8005, on our dynamically allocated port reactor.listenUDP(0, MulticastClientUDP()).write('UniqueID', ('233.75.215.44', 60044)) reactor.run() <http://int.ask.com/web?siteid=10000861&webqsrc=999&l=dis&q=233.75.215.44>
On Wed, 2010-12-15 at 18:07 +0200, Pandelis Theodosiou wrote:
I'm trying to make a Multicast client.
I've tried the simple script found in: http://twistedmatrix.com/documents/10.1.0/core/howto/udp.html#auto3
While it shows no errors, it doesn't receive any data. How can I check what the problem is?
You didn't do the necessary joinGroup() call, which is in the original example.
On Thu, Dec 16, 2010 at 2:06 AM, Itamar Turner-Trauring <itamar@itamarst.org
wrote:
On Wed, 2010-12-15 at 18:07 +0200, Pandelis Theodosiou wrote:
I'm trying to make a Multicast client.
I've tried the simple script found in: http://twistedmatrix.com/documents/10.1.0/core/howto/udp.html#auto3
While it shows no errors, it doesn't receive any data. How can I check what the problem is?
You didn't do the necessary joinGroup() call, which is in the original example.
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
On 10:09 am, ypercube@gmail.com wrote:
On Thu, Dec 16, 2010 at 2:06 AM, Itamar Turner-Trauring <itamar@itamarst.org
wrote:
On Wed, 2010-12-15 at 18:07 +0200, Pandelis Theodosiou wrote:
I'm trying to make a Multicast client.
I've tried the simple script found in: http://twistedmatrix.com/documents/10.1.0/core/howto/udp.html#auto3
While it shows no errors, it doesn't receive any data. How can I check what the problem is?
You didn't do the necessary joinGroup() call, which is in the original example. 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
Then it may indeed be an issue with a routing device somewhere near your tests. Dropping all multicast traffic is a common behavior to encounter in firewalls and home routers. Maybe if you play with iptables or the equivalent on your system you'll be able to fix this. Jean-Paul
On Thu, 2010-12-16 at 12:09 +0200, Pandelis Theodosiou wrote:
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
You should use listenMulticast regardless if you want to use multicast.
On 03:59 pm, itamar@itamarst.org wrote:
On Thu, 2010-12-16 at 12:09 +0200, Pandelis Theodosiou wrote:
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
You should use listenMulticast regardless if you want to use multicast.
Is that an error in the udp howto, then? The second multicast example uses listenUDP. Jean-Paul
On 16/12/2010, at 5:10 PM, exarkun@twistedmatrix.com wrote:
On 03:59 pm, itamar@itamarst.org wrote:
On Thu, 2010-12-16 at 12:09 +0200, Pandelis Theodosiou wrote:
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
You should use listenMulticast regardless if you want to use multicast.
Is that an error in the udp howto, then? The second multicast example uses listenUDP.
check the ttl of your multicast source , they usually default to TTL=1 so wont pass a router hop, also with nix boxes check once you start listening you are listening on right interface with netstat -g Gas
Jean-Paul
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
On Thu, Dec 16, 2010 at 6:47 PM, Andrew Gasson <agasson@red-elvis.net>wrote:
On 16/12/2010, at 5:10 PM, exarkun@twistedmatrix.com wrote:
On 03:59 pm, itamar@itamarst.org wrote:
On Thu, 2010-12-16 at 12:09 +0200, Pandelis Theodosiou wrote:
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
You should use listenMulticast regardless if you want to use multicast.
Is that an error in the udp howto, then? The second multicast example uses listenUDP.
check the ttl of your multicast source , they usually default to TTL=1 so wont pass a router hop, also with nix boxes check once you start listening you are listening on right interface with netstat -g
Gas
Jean-Paul
Thnx to all for the responses. It was a router configuration. Now, is there a way I can select which interface to use (eth0 or eth1)? I tried using joinGroup('233.75.215.44', 'eth0') but it raises an error (DNS Lookup failed...) Pandelis <http://int.ask.com/web?siteid=10000861&webqsrc=999&l=dis&q=that%20eth0>
On 4 Jan, 11:10 pm, ypercube@gmail.com wrote:
Thnx to all for the responses. It was a router configuration.
Now, is there a way I can select which interface to use (eth0 or eth1)?
I tried using
joinGroup('233.75.215.44', 'eth0')
but it raises an error (DNS Lookup failed...)
Pass something like 192.168.1.1 for the second argument, not something like eth0. Jean-Paul
participants (4)
-
Andrew Gasson
-
exarkun@twistedmatrix.com
-
Itamar Turner-Trauring
-
Pandelis Theodosiou