title: Python Socket Receive Large Amount of Data
body: <p>When I try to receive larger amounts of data it gets cut off and I have to press enter to get the rest of the data. At first I was able to increase it a little bit but it still won't receive all of it. As you can see I have increased the buffer on the conn.recv() but it still doesn't get all of the data. It cuts it off at a certain point. I have to press enter on my raw_input in order to receive the rest of the data. Is there anyway I can get all of the data at once? Here's the code.</p>
  <pre><code>port = 7777
  sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  sock.bind(('0.0.0.0', port))
  sock.listen(1)
  print (&quot;Listening on port: &quot;+str(port))
  while 1:
      conn, sock_addr = sock.accept()
      print &quot;accepted connection from&quot;, sock_addr
      while 1:
          command = raw_input('shell&gt; ')
          conn.send(command)
          data = conn.recv(8000)
          if not data: break
          print data,
      conn.close()
  </code></pre>