473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Re: Twisted Matrix and multicast broadcast

On Thu, 9 Oct 2008 06:03:44 -0700 (PDT), Stodge <st****@gmail.comwrote:
[snip]
class MulticastServerUDP(DatagramProtocol):
def startProtocol(self):
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 MulticastClientUDP(DatagramProtocol):
def startProtocol(self):
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 2058
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.comwrote:
[snip]
class MulticastServerUDP(DatagramProtocol):
* *def startProtocol(self):
* * * *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 MulticastClientUDP(DatagramProtocol):
* *def startProtocol(self):
* * * *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
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...
11
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...
2
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...
1
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...
2
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...
2
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...
1
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...
2
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.