[Twisted-Python] peer 2 peer, udp, stdio -> very confused

varname varname at gmail.com
Mon Dec 4 04:26:10 EST 2006

hi all,

first: I have been reading the topics on this list regarding apps that
need to be client/server at the same time, use udp, need to be able to
react to user input while the reactor is running with much interest,
but I'm very confused now as to how I should proceed with my own

In short: I'm trying to create a peer 2 peer application that has a
text-based gui (commandline), driven by user input and communicates
with other peers over udp (and occasionally over tcp, to transfer

I'm just really confused over some basic concepts. Am I correct that I
can just create a simple class extending protocol.DatagramProtocol to
facilitate the raw udp sending / receiving? Then use that in a Factory
class (MyClientFactory) to 'layer' the p2p protocol functionality on?
Where do I put my stdio implementation then? And am I right that the
only thing needed for udp to work is to do a
reactor.listenUDP(portnum, MyClientFactory()) or do I need to use two
factory classes, one for the client 'bit' and one for the server?

I realise that's a lot of questions, but the sheer size of twisted has
overwhelmed me a bit and I'd appreciate any help you can give.

More information about the Twisted-Python mailing list