Sending binary pickled data through TCP
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.
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
> 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.
> ---Irmen de Jong
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list