[Twisted-Python] UDP Support sanity check

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi

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 
IUDPTransport
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?

Richard



- -- 
QinetiQ                                  
B009 Woodward Building
St. Andrews Road
Malvern
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAhORk7Z7YaKfan9kRAiuzAJ9TlVM1puA5TIDNSfKTvH/xIJHxzwCeMrRE
mzGko+L421THScL3FgbqKPU=
=xiC0
-----END PGP SIGNATURE-----




More information about the Twisted-Python mailing list