A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/083563.html below:

Sockets: Sending/receiving arbitrary amounts of data

Sockets: Sending/receiving arbitrary amounts of data Sockets: Sending/receiving arbitrary amounts of dataDaniel Klein danielk at aracnet.com
Mon Apr 30 09:56:34 EDT 2001
On Sun, 29 Apr 2001 10:54:17 -0700, Neil Schemenauer <nas at python.ca> wrote:

>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:

Thanks Neil, this is exactly what I was proposing to do.

Question: Why is the protocol using 'u' instead of 'i' in the format string?

	"%lu:" % len(s)
vs
	"%li:" % len(s)

Thanks for the code,

Dan


More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4