~cbehrens/nova/lp844160-build-works-with-zones

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/core/howto/listings/udp/MulticastClient.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from twisted.internet.protocol import DatagramProtocol
 
2
from twisted.internet import reactor
 
3
from twisted.application.internet import MulticastServer
 
4
 
 
5
class MulticastClientUDP(DatagramProtocol):
 
6
 
 
7
    def datagramReceived(self, datagram, address):
 
8
            print "Received:" + repr(datagram)
 
9
 
 
10
# Send multicast on 224.0.0.1:8005, on our dynamically allocated port
 
11
reactor.listenUDP(0, MulticastClientUDP()).write('UniqueID', 
 
12
                                                 ('224.0.0.1', 8005))
 
13
reactor.run()