473,569 Members | 2,752 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 1590

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

Similar topics

1
2446
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
3582
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
2570
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
1504
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
6215
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
2065
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
7694
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7921
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. ...
1
7666
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
7964
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
5504
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
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
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...
1
2107
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
936
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.