[Twisted-Python] UDP Support sanity check

Richard Taylor r.taylor at eris.qinetiq.com
Tue Apr 20 04:50:38 EDT 2004

Hash: SHA1


I am trying to implement support for the UDP functionality I need. I think 
that I need to implement the following classes:

For server support:

UDPPort(udp.Port) - adding support for broadcast
ConnectedUDPPort(UDPPort) - connected variant

For client (connection) support:

UDPConnectionBase(FileDescriptor) - creation of non-bound UDP sockets
UDPConnection(UDPConnectionBase) - addition of write method to implement 
UDPConnectedConnection(UDPConnectionBase) - support for 'connected' UDP socket 
and write method without host,port arguments.

UDPConnector(base.Connector) - connector class that can create use the 
UDPConnection objects.
UDPConnectedConnector(UDPConnector) - one that works with 
UDPConnectedConnection objects.

Extend the IReactorUDP interface and reactor implementation to support 
connectXXX methods for the new connector types.

I am trying to support the creation of UDP connectors that are meant for 
sending datagrams and will never be bound to a local port and listened on. 
The current support for UDP does not implement and UDP connector type objects 
only UDP Port type objects. This means that a bind is always performed even 
when the connection is only meant for sending. 

I have most of the implementation written (at least in outline). 

One question. It appears to me that for UDP connection objects that concept of 
a protocol does not make much sense. The IUDPTransport interface does have a 
read method (as you would expect) so the protocol would never be called. This 
also calls in to question the need for a 'protocol factory' for such 
connections. Am I correct in this or am I missing something?


- -- 
B009 Woodward Building
St. Andrews Road
Worcs WR14 3PS
Jabber: RichardTaylor at jabber.org
PGPKey: http://search.keyserver.net:11371/pks/lookup?op=get&search=0xA7DA9FD9
Key fingerprint = D051 A121 E7C3 485F 3C0E  1593 ED9E D868 A7DA 9FD9
Version: GnuPG v1.2.1 (GNU/Linux)


More information about the Twisted-Python mailing list