Designing socket messaging format

Ype Kingma ykingma at
Tue Nov 13 20:16:40 CET 2001

Stephen wrote:
> cimarron+google at (Cimarron Taylor) wrote in message news:<29e28c51.0111120234.35d10048 at>...
> > shriek at (Stephen) wrote in message news:<97ae44ee.0111111912.14006c7f at>...
> > > I'm developing a program which sends messages back and forth
> > > between two servers using sockets.  The message format I've
> >
> > Why not save yourself a little coding and just use netstrings?
> >
> >      more info:
> >  advogato copy:
> >    python code:
> >    description:
> Thanks for pointing this out. Is anybody actually
> using it though ? Would be a bit concerned with it
> being 0.2 release.

It works fine. For efficiency you might need to add buffering 
especially on the receiving side.

> I guess the main reason not to use netstrings is
> the ability to interface with other servers that
> don't have the netstrings package or the desire to
> install it.  Sockets seem to be the lowest
> common denominator.
You would normally use them for messages both
ways, with the same python module on both sides.

Have fun,
email at

More information about the Python-list mailing list