title: Reading message from socket in C
body: <p>I try to understand reading from socket in C (Linux), this is only part of code:</p>
  
  <pre><code>while(success == 0) {
  
      while((n = read(sockfd, buffer, BUFFSIZE, 0)) &gt; 0) {
          printf("%s",buffer);
          bzero(buffer,BUFFSIZE);
      }
      success = 1;
      printf("###");
  
  }
  </code></pre>
  
  <p>The message is printed, but the three hashes (###) are never print? Why? The program seems to block on read(). Here i do just printing, but what i need to do is to buffer the whole message and then process it. </p>