473,387 Members | 1,283 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,387 software developers and data experts.

Twisted Matrix and multicast broadcast

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'
# Join a specific multicast group, which is the IP we will
respond to
self.transport.joinGroup('224.0.0.1')

def datagramReceived(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.listenMulticast(8005, MulticastServerUDP())
reactor.run()
and:

from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
from twisted.application.internet import MulticastServer

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

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

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

# Send multicast on 224.0.0.1:8005, on our dynamically allocated port
reactor.listenMulticast(0, MulticastClientUDP())
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 1571

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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...

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.