title: Unpickle an object received from socket leads to "Ran out of input"
body: <p>I am sending a dictionary across network using sockets.
  The client sends a pickled dictionary and then the server has to unpickle it.</p>
  <pre><code>def getRequest(conn):
      request = b''
      while True:
          part = conn.recv(10240)
          if len(part) == 0:
              break
          request += part
      request = pickle.loads(request)
      return request
  </code></pre>
  <p>Above is the server side code which receives the request.
  The error I'm getting is on this line:</p>
  <pre><code>request = pickle.loads(request)
  </code></pre>
  <p>And the error is:</p>
  <pre class="lang-none prettyprint-override"><code>Exception ignored in thread started by: &lt;function main at 0x7f85e6a888b0&gt;
  Traceback (most recent call last):
    File &quot;/home/w0rk5107h/Documents/AK-Daily/main/server/server.py&quot;, line 33, in main
      request = pickle.loads(request)
  EOFError: Ran out of input
  </code></pre>
  <p>This exact method has worked for in the past but I don't know why it is not working now.</p>