[Twisted-Python] Dynamic listening to UDP ports?

Torbjörn Einarsson torbjorn at einarssons.se
Tue Apr 26 16:52:45 EDT 2005


Thanks a lot!

A related question:
how do I in the simplest way send UDP data to 10 different ports.

In standard Python I would do
sock = socket.socket(AF_INET, socket.SOCK_DGRAM)
for port in portList:
    sock.sendto(data,(host,port))
sock.close()

What is the corresponding thing in Twisted?  (I've only found listenUDP and
connected UDP).

BR,
Torbjörn

-----Original Message-----
From: twisted-python-bounces at twistedmatrix.com
[mailto:twisted-python-bounces at twistedmatrix.com] On Behalf Of Itamar
Shtull-Trauring
Sent: den 26 april 2005 18:52
To: Twisted general discussion
Subject: Re: [Twisted-Python] Dynamic listening to UDP ports?

To stop listening on UDP port:

port = reactor.listenUDP(1243, p)
port.stopListening()


_______________________________________________
Twisted-Python mailing list
Twisted-Python at twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python






More information about the Twisted-Python mailing list