Pickled objects over the network
Jean-Paul Calderone
exarkun at divmod.com
Fri Jul 20 11:55:36 EDT 2007
On Fri, 20 Jul 2007 08:27:13 -0700, Walker Lindley <brotherjenos at gmail.com> wrote:
>It doesn't interface well because the string you end up with often doesn't
>fit into a single packet. Therefore you have to add a layer of protocol on
>top of it that allows you to check to make sure you have the whole string
>received before trying to unpickle it. This the case even if you use
>socket's makefile() method to make a file descriptor.
This is somewhat misleading. TCP doesn't guarantee any minimum packet size
larger than a single byte. Any messaging system which uses strings longer
than one byte must have a framing protocol to be reliable. So, this isn't
really specific to pickle. Basically, all protocols have to address this.
Jean-Paul
More information about the Python-list
mailing list