title: What are SO_SNDBUF and SO_RCVBUF
body: <p>Can you explain me what exactly are <code>SO_SNDBUF</code> and <code>SO_RCVBUF</code> options?</p>
  
  <p>OK, for some reason the OS buffers the outgoing/incomming data but I'd like to clarify this subject.</p>
  
  <ul>
  <li>What is their role (generally)?</li>
  <li>Are they per-socket buffers?</li>
  <li>Is there a connection between Transport layer's buffers (the TCP buffer, for example) and these buffers?</li>
  <li>Do they have a different behaviour/role when using stream sockets (TCP) and when using connectionless sockets (UDP)? </li>
  </ul>
  
  <p>A good article will be great too.</p>
  
  <p>I googled it but didn't find any useful information.</p>