473,657 Members | 2,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Twisted Matrix and multicast broadcast

On Thu, 9 Oct 2008 06:03:44 -0700 (PDT), Stodge <st****@gmail.c omwrote:
[snip]
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')

[snip]

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')

[snip]

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.
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 .

Jean-Paul
Oct 9 '08 #1
1 2067
On Oct 9, 9:33*am, Jean-Paul Calderone <exar...@divmod .comwrote:
On Thu, 9 Oct 2008 06:03:44 -0700 (PDT), Stodge <sto...@gmail.c omwrote:
[snip]
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')
[snip]
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')
[snip]
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.

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 .

Jean-Paul
Thanks. So the server write should be:

self.transport. write("data", ('224.0.0.1', 8005))

I guess I can't run multiple peers on the same PC as they'll all be
listening on port 8005.
Oct 9 '08 #2

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

Similar topics

1
2453
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
3591
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 as long as I have the server process running I can ping the multicast IP and get a response. The...
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
2573
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 any alternative methods or a workaround? Thanks alot for your time!
2
1507
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 everything can be installed with it). I was hoping to find something as nice (and complete) as Perl's...
1
6271
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 s1 = new Socket(AddressFamily.InterNetworkV6, SocketType.Dgram,
2
1792
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
0
1596
by: Stodge | last post by:
I'm trying to get a simple multicast application working using Twisted; so far I have: 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'
0
8820
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8718
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8499
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8601
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
2
1601
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.