Sockets: Sending/receiving arbitrary amounts of data
Doobee R. Tzeck
drt at un.bewaff.net
Tue May 1 02:17:32 EDT 2001
Neil Schemenauer <nas at python.ca> writes:
> Daniel Klein wrote:
> > What if the server doesn't know in advance how much data will
> > be sent from the client?
>
> You need to build this into your protocol. A lot of existing
> protocols use terminators to signal the end of data like "\r\n"
> or something similar. I like using Dan Bernstein's netstring
> protocol:
>
> http://cr.yp.to/proto/netstrings.txt
Perhaps somebody might be interested in my NetStringIO module. It
wraps arround a file like object and conserts all reads and
writes to netstrings. It can be found at http://koeln.ccc.de/~drt/
Suggestions about Documentation Style and effency are very
welcome.
drt
--
Crypto Anarchy: encryption, digital money, anonymous networks,
digital pseudonyms, zero knowledge, reputations, information markets,
black markets, collapse of governments, freedom.
http://koeln.ccc.de/~drt/
More information about the Python-list
mailing list