473,573 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Twisted Matrix and multicast broadcast

I'm trying to get a simple multicast application working using
Twisted; so far I have:

from twisted.interne t.protocol import DatagramProtoco l
from twisted.interne t import reactor
from twisted.applica tion.internet import MulticastServer

class MulticastServer UDP(DatagramPro tocol):
def startProtocol(s elf):
print 'Started Listening'
# Join a specific multicast group, which is the IP we will
respond to
self.transport. joinGroup('224. 0.0.1')

def datagramReceive d(self, datagram, address):
# The uniqueID check is to ensure we only service requests
from
# ourselves
if datagram == 'UniqueID':
print "Server Received: " + repr(datagram)
self.transport. write("data", address)

# Listen for multicast on 224.0.0.1:8005
reactor.listenM ulticast(8005, MulticastServer UDP())
reactor.run()
and:

from twisted.interne t.protocol import DatagramProtoco l
from twisted.interne t import reactor
from twisted.applica tion.internet import MulticastServer

class MulticastClient UDP(DatagramPro tocol):
def startProtocol(s elf):
print 'Started Listening'
# Join a specific multicast group, which is the IP we will
respond to
self.transport. joinGroup('224. 0.0.1')

self.transport. write('UniqueID ',('224.0.0.1', 8005))

def datagramReceive d(self, datagram, address):
print "Received:" + repr(datagram)

# Send multicast on 224.0.0.1:8005, on our dynamically allocated port
reactor.listenM ulticast(0, MulticastClient UDP())
reactor.run()

*************** *************** *************** *************** *************** *********

No surprises there! But how do I get the server to send to all clients
using multicast? transport.write requires an address. Any suggestions
appreciated.

Thanks
Oct 9 '08 #1
0 1593

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2450
by: Fazer | last post by:
Hello, I am very interested in fooling around with Twisted Matrix's HTTP Web Server. I was thinking if .rpy scripts would run much faster than traditional CGI scripts? After looking how asynchronous Twisted's framework really is, I have been interested in it. Thanks,
11
3585
by: mir nazim | last post by:
hi, i m planning to start writing intranet applications and want ur real cool advices for choosing the correct platform. the choice is between the three: 1. Twisted 2. Medusa 3. Zope (i do not know any of the three).
2
530
by: Jim H | last post by:
Is there something special I need to do to send data to a multicast IP and have it go across a router? Router is a Win2000 Server connecting 2 networks via RRAS PPTP. The routing appears to be working because I can ping the multicast address and get responses from the server on the other network. I didn't think ping would work like that but...
1
280
by: Naveen Mukkelli | last post by:
Hi, When I run 2 or more clients on the same machine, the first client application is receiving multicast messages but not the subsequent clients. I'm using the same, multicast address and port for all the clients as this is the default multicast ip, all the clients automatically register to this ip and port number.
2
2572
by: Elliot Hughes | last post by:
Hi Everyone, I am trying to right a server that can receive a message and send it to all clients using UDP on twisted. I have got it so far that it can echo to the client that sent the message but not to the rest. I tried using multicast but that requires almost total rewrite, and the client which is not in python can't handle it. Are there...
2
1505
by: Chaz Ginger | last post by:
I have a rather large Python/Twisted Matrix application that will be run on Windows, Linux and perhaps Macs. I was wondering if there are any tools that can be used to create an installer that will bring in Python, Twisted Matrix, my application libraries and anything else I need? I have tried using ezsetup with no luck (it seems not...
1
6231
by: jlamanna | last post by:
Hi. I'm adding IPV6 support to my app, and I have a UDP Broadcast socket that I need to redo using IPV6. I know that IPV6 doesn't have a notion of broadcast anymore, its all multicast (broadcast translates to a multicast address of ff02::1 essentially). However, the following code throws an exception on the SetSocketOption() call: Socket...
2
1790
by: =?Utf-8?B?aXdkdTE1?= | last post by:
Hi, im writing a program that uses the multicast address to send data to multiple clients at the same time. I would like to be able to get the multicast address of the current network programmatically...is this possible, and if yes, how? ive done google searches, yet i havent found a thing on how to do this. thanks! -- -iwdu15
1
2066
by: Jean-Paul Calderone | last post by:
On Thu, 9 Oct 2008 06:03:44 -0700 (PDT), Stodge <stodge@gmail.comwrote: Your server and client are both listening on the multicast address 224.0.0.1. Traffic sent to that address will be delivered to both of them. If you want to send something to all clients listening on that address, then that's the address to pass to transport.write. ...
0
7699
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8027
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8202
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7788
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8066
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5594
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3733
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2216
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1041
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.