title: How to set maximum buffer size in Node.js?
body: <p>I was creating a server application, which uses socket.write() to send data back to the clients.</p>
  
  <p>Here, I got the problem of managing buffer size. Suppose the connection between server and client broke down, and server was not aware of the problem. So, it keeps writing to the buffer. In such situation, I want to limit the maximum buffer size, so that it can throw errors before it consumes lots of resources. </p>
  
  <p>I know kMaxLength in node_buffer.h controls the size of buffer, but I do not think it's a good idea to change its value via some self-defined methods. Is there any other method to manage the size?</p>