title: Error reading from socket using socket.makefile to readlines
body: <p>I'm having a trouble and I don't know what is happening. 
  I'm coding a little client -  server application using unix sockets in python. The commands that I would like to send over this connection are all finished with a newline character.  Then I decided to use a file-like socket, by using socket.makefile('r'). </p>
  
  <p>The problem is that if I try to send a line with more than 8k bytes of data, the server is not able to read it. I´ve checked that if instead of use a makefile, I use a socket.recv(65560)  the server works properly. </p>
  
  <p>But I would like to know why is this happening.
  Thanks in advance.</p>
  
  <p>Little code  to test:</p>
  
  <pre><code>#!/usr/bin/env python
  import threading
  import socket
  import errno
  import time
  import os
  import sys
  import signal
  datalines = []
  dat6 = "A" * 6144 + "\n" #6k
  dat7 = "B" * 7168 + "\n" #7k
  dat8 = "C" * 8192 + "\n" #8k
  dat10 = "D" * 10240 + "\n" #10k
  dat16 = "E" * 16364 + "\n" #16k
  
  datalines.append(dat6)
  datalines.append(dat7)
  datalines.append(dat8)
  datalines.append(dat10)
  datalines.append(dat16)
  
  
  ev = threading.Event()
  unixsocket="/tmp/socket.sock"
  def runServer():
      if os.path.exists(unixsocket):
          os.remove(unixsocket)
      server = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
      server.bind(unixsocket)
      sockfile = server.makefile('r')
      print "Listening..."
      while not ev.isSet():
          for line in sockfile:
              print "RCV: %s"%line
  
  def runClient():
      clientsocket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
      clientsocket.connect(unixsocket)
      print "Conected"
      for line in datalines:
          print "Sending data....%s" % line[0]
          clientsocket.sendall(line)
  
  
  def main():
      print "Testing makefile sockets with a big mesagge to send"
      #Create a unix socket server and a client socket server
      #Send two messages from the client, and see the server response.
      server = threading.Thread(target=runServer,args=())
      client = threading.Thread(target=runClient,args=())
      print "Run server ..."
      server.start()
      print "Waiting for the client"
      time.sleep(2)
      print "Start the client"
      client.start()
      try:
          while True:
              time.sleep(1)
      except KeyboardInterrupt:
          print "Bye!!!"
          ev.set()
          #Abrupt termination
          os.kill(os.getpid(), signal.SIGKILL)
  
  
  if __name__  == "__main__":
      print "Running tests..."
      main()
  </code></pre>