title: Maximum data size that can be sent and received using sockets, at once?(TCP socket)
body: <p>I am designing a game which has master and multiple players. They send and receive data using TCP sockets. </p>
  
  <p>Players transfer character strings between themselves via TCP sockets.The programs are being executed in red hat linux 6 os .</p>
  
  <p>The character string transferred between players is of the type </p>
  
  <pre><code>char chain[2*hops+10];
  </code></pre>
  
  <p>The player code on sender side is </p>
  
  <pre><code>len = send(to,chain,sizeof(chain),0);
  if (len != sizeof(chain)) {
  perror("send");
  exit(1);}
  </code></pre>
  
  <p>The code where player receives the data is like this :</p>
  
  <pre><code>char chain[2*hops+10];
  len = recv(current,chain,sizeof(chain),0);
  </code></pre>
  
  <p>The value of hops is same for both the players.
  For hops value till around 8000 it is working fine, but once the hops value crosses some point, the same program is not working. I believe data is not transferred in one go.
  Is there a maximum buffer size for send and recv buffer?</p>
  
  <p>Note:  The sockets between them are opened using this code: </p>
  
  <pre><code>s = socket(AF_INET, SOCK_STREAM, 0);
  </code></pre>
  
  <p>and then the usual connect and bind sockets on both sides.</p>