title: how to write/send a specific number of bytes to a socket totally but not partially?
body: <p>I want to write a specific number of bytes to a socket, </p>
  
  <pre><code>n=write(sock_fd, buf, len);
  </code></pre>
  
  <p>if <code>n&lt;len</code>,  I would rather no bytes are written into the socket,
  is it possible or not?
  thanks!</p>