OO design and multiple local sockets
andrew at indranet.co.nz
Thu Jan 30 13:36:12 CET 2003
I've got an awful case of writer's block on this one :-(
Problem: I'm writing an app (an implementation of HIP, see
www.hip4inter.net) that uses raw sockets in a big way. It needs to bind
local sockets to each IP address on the system so it can transmit packets
with each source address. It also needs to know which address packets were
received on, and from where. So far, so good. It's threaded (pretty much
necessarily). There are two pools of sockets for two different protocols
that have to interact.
Just the code for the protocol transforms and state machines is about 7k
lines, including tests, and works, but with only a single unbound local
socket, so some features I can't do yet.
What I can't figure out is what a clean OO design for the socket handling
looks like, managing the various queues and worker threads without getting
really hairy. Can anyone help?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 196 bytes
Desc: not available
More information about the Python-list