title: TCP connection and a different buffer size for a client and a server
body: <p>What will happen if I will establish a connection between a client and a server, and configure a different buffer size for each of them.</p>
  <p>This is my client's code:</p>
  <pre><code> import socket,sys
  
  TCP_IP = sys.argv[1]
  TCP_PORT = int(sys.argv[2])
  BUFFER_SIZE = 1024
  MESSAGE = &quot;World! Hello, World!&quot;
  
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.connect((TCP_IP, TCP_PORT))
  s.send(MESSAGE)
  data = s.recv(BUFFER_SIZE)
  s.close()
  
  print &quot;received data:&quot;, data
  </code></pre>
  <p>Server's code:</p>
  <pre><code> import socket,sys
  
  TCP_IP = '0.0.0.0'
  TCP_PORT = int(sys.argv[1])
  BUFFER_SIZE = 5
  
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.bind((TCP_IP, TCP_PORT))
  s.listen(1)
  
  while True:
      conn, addr = s.accept()
      print 'New connection from:', addr
      while True:
          data = conn.recv(BUFFER_SIZE)
          if not data: break
          print &quot;received:&quot;, data
          conn.send(data.upper()) 
      conn.close()
  </code></pre>
  <p>That means I will be limited to only 5 bytes? Which means I won't be able to receive the full packet and will lose 1024-5 packets?
  I or does it mean I am able to get only packets of 5 bytes, which means that instead of receiving one packets of 1024 bytes as the client sent it, I'll have to divide 1024 by 5 and get 204.8 packets (?) which sounds not possible.</p>
  <p>What in general is happing in that code?</p>
  <p>Thanks.</p>