From: Lawrence D'Oliveiro on
In message <mailman.797.1279235288.1673.python-list(a)python.org>, MRAB wrote:

> You could either open and close a connection for each image, or have the
> client tell the server how many bytes it's going to send, followed by
> the bytes (my preference would be to send the size as a string ending
> with, say, a newline).

I have used variations on this
<http://www.codecodex.com/wiki/index.php?title=Simple_Chunk_Protocol_Format>
in several projects.