Re: transmit an array via socket

Discussion in 'Python' started by Hendrik van Rooyen, Oct 27, 2007.

  1. "Jeff Pang" <p...uno.com> wrote:


    I want to transmit an array via socket from a host to another.
    How to do it? thank you.

    pickle it and send it and unpickle it on the other side.

    See the cPickle module docs for loads and dumps.

    - Hendrik
    Hendrik van Rooyen, Oct 27, 2007
    #1
    1. Advertising

  2. Hendrik van Rooyen

    Bryan Olson Guest

    Hendrik van Rooyen wrote:
    > "Jeff Pang" <p...uno.com> wrote:
    >> I want to transmit an array via socket from a host to another.
    >> How to do it? thank you.

    >
    > pickle it and send it and unpickle it on the other side.
    >
    > See the cPickle module docs for loads and dumps.


    In particular note:

    Warning: The pickle module is not intended to be secure
    against erroneous or maliciously constructed data. Never
    unpickle data received from an untrusted or
    unauthenticated source.

    Pickle works great for lots of things, but combining
    pickle and socket is scary. If an unfriendly can connect
    to our socket, they can feed us a *poison* pickle. The
    marshal module is at least as bad.

    The marshaling in RPC facilities tends to be much safer.


    --
    --Bryan
    Bryan Olson, Oct 27, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rasha
    Replies:
    0
    Views:
    1,685
    Rasha
    Mar 17, 2005
  2. SteveR
    Replies:
    1
    Views:
    583
    bruce barker
    Oct 19, 2004
  3. Replies:
    6
    Views:
    5,815
    JohnH
    May 10, 2006
  4. Liu Ju
    Replies:
    3
    Views:
    1,347
    Thomas Matthews
    Sep 14, 2004
  5. Jeff Pang

    transmit an array via socket

    Jeff Pang, Oct 27, 2007, in forum: Python
    Replies:
    2
    Views:
    289
    7stud
    Oct 27, 2007
Loading...

Share This Page