Sending binary pickled data through TCP

David Hirschfield davidh at ilm.com
Fri Oct 13 20:19:03 CEST 2006


I've looked at pyro, and it is definitely overkill for what I need.

If I was requiring some kind of persistent state for objects shared 
between processes, pyro would be awesome...but I just need to transfer 
chunks of complex python data back and forth. No method calls or keeping 
state in sync.

I don't find socket code particularly nasty, especially through a 
higher-level module like asyncore/asynchat.
-Dave

Irmen de Jong wrote:
> David Hirschfield wrote:
>   
>> I have a pair of programs which trade python data back and forth by 
>> pickling up lists of objects on one side (using 
>> pickle.HIGHEST_PROTOCOL), and sending that data over a TCP socket 
>> connection to the receiver, who unpickles the data and uses it.
>>
>> So far this has been working fine, but I now need a way of separating 
>> multiple chunks of pickled binary data in the stream being sent back and 
>> forth.
>>     
> [...]
>
> Save yourself the trouble of implementing some sort of IPC mechanism
> over sockets, and give Pyro a swing: http://pyro.sourceforge.net
>
> In Pyro almost all of the nastyness that is usually associated with socket
> programming is shielded from you and you'll get much more as well
> (a complete pythonic IPC library).
>
> It may be a bit heavy for what you are trying to do but it may
> be the right choice to avoid troubles later when your requirements
> get more complex and/or you discover problems with your networking code.
>
> Hth,
> ---Irmen de Jong
>   

-- 
Presenting:
mediocre nebula.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20061013/33f05eea/attachment.html>


More information about the Python-list mailing list