User Profile

Collapse

Profile Sidebar

Collapse
Ivan Dewolf
Ivan Dewolf
Last Activity: Oct 22 '10, 06:24 PM
Joined: Aug 23 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • um.... out of ignorance?
    to be honest, I'm a bit fuzzy as to how to choose between the two.
    See more | Go to post

    Leave a comment:


  • hokay, solved it. Brak it into chunks and send 'em.

    The server launches the client .py

    server snippet:

    Code:
    mysocket = socket(AF_INET,SOCK_DGRAM)
    mysocket.bind(addr)
    #launch client.py
    clientthread().start()
    pkl_str = ""
    Dlen = mysocket.recv(buf)
    for i in range(0,int(int(Dlen)/buf)+1):
        data = mysocket.recv(buf)
        pkl_str +=data
    dict = pickle.loads(pkl_str)
    ...
    See more | Go to post

    Leave a comment:


  • also, security is not an issue, I am aware of the security issues.

    Here's some code fragments:
    Code:
    pkl_dict = cPickle.dumps(heir_dict)
    pkl_split = pkl_dict.split("\n")
    print len(pkl_split)
    i = 0
    for line in pkl_split:
        i += 1
        print str(i)+" "+line
        mysocket.send(line)
    my sample pickle returns len(pkl_split) = 45499
    ...
    See more | Go to post

    Leave a comment:


  • Ivan Dewolf
    started a topic sending pickled dictionary over a socket

    sending pickled dictionary over a socket

    I saw this thread:
    http://bytes.com/topic/python/answers/553952-sending-dictionary-via-network

    which works nicely for tiny dictionaries, but my sample pickled dictionary is about 500,000 characters long, and this method doesn't work. I tried splitting the dictionary on \n and then joining it, but the sockets hang after a coupla thousand lines.

    Surely, passing a dictionary over a socket must be a fairly common...
    See more | Go to post
No activity results to display
Show More
Working...