Twisted vs POS (Plain-old sockets)

Darren Kirby bulliver at
Mon Sep 4 14:40:33 EDT 2006

On 9/3/06, Jean-Paul Calderone <exarkun at> wrote:
> On Sun, 3 Sep 2006 00:19:17 -0700, Darren Kirby <bulliver at> wrote:
> >Hey all,
> >
> >I have a (FOSS) project here that I am about to start that requires TCP
> >networking support, and in fact, will require me to design and implement a
> >(text based) protocol from scratch.
> I'm sorry.

Don't be sorry, I am doing this for fun and to learn...

> If there are features you don't need, then don't use them.  What does their
> existence cost you?  Are you going to use the sunaudio module from the
> standard library?  If not, is this an argument in favor of using C++ instead
> of Python?

Well, the question I have is if it is worth digging through all the
complexity (in the code itself and docs) for the few nuggets I do
need... I am well aware I do not need to use everything...

> As for documentation, many people say it is lacking, but perhaps one person
> in a thousand points out _how_ or _where_ it is lacking.  Unfortunately it
> is difficult to improve things (or even determine if they really are lacking)
> with this level of feedback.

I am certainly not trying to dump on twisted. As for what is lacking,
the many methods I looked up that say simply "Not Documented" would be
the biggest problem....

> Keep in mind that in addition to the online documentation, there is a Twisted
> book, an extremely helpful twisted mailing list (with years of archives
> online), and an IRC channel populated at nearly all hours of the day with
> people who can answer Twisted questions.

I am aware of the book, and if I decide to go the twisted route I
would certainly purchase it. However, not that I am overly swayed by
amazon reviews, but the consistent majority of them have said that the
book is big on specifics (as in, explaining the example code and not
much else), and small on the 'big-picture' so to speak. If this is
true I might as well stay with the docs.

> Talking to the TCP/IP stack is surprisingly difficult to get right.  Since
> it is extremely unlikely that you actually _care_ about all of the random,
> stupid differences between different TCP implementations, you should use
> Twisted, since it does its best to hide these differences and instead
> present a uniform API.

Fair enough...

> If you use bare sockets, you will need to learn many of these quirks yourself,
> frequently through a bug report from a user, since many of them are
> undocumented.

True, though keep in mind this is as much of a learning exercise for
me as it is to get an app out the door quick.

> Twisted is great.  It will speed up your development time and reduce the
> amount of defects you need to deal with.  It will

OK, I will stick with twisted and see if I can't figure it out, and
perhaps play with asyncore and see for myself what will work. Please
note I was really just looking for some anecdotes from experienced
programmers that may have found themselves in my situation, and the
solutions they chose...

> Hope this helps,

Sure it did, thanks for taking the time to respond, also thanks to
Guido and Istvan,

> Jean-Paul

darren kirby :: Part of the problem since 1976 ::
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972

More information about the Python-list mailing list