I was just playing around with Buffers in Node and am trying to understand them. I'm not too sure what the reason is for this event:
Here is my code:
var test = new Buffer(16);
test.fill(0);
test.write("Hey");
res.send(test.toString());
res.send(test.toString());
The message Hey is only sent once. Can you explain this to me? Also, If the two lines looked like so:
res.send(test.toString());
res.send(test);
It would say Hey, but not download the second Buffer. Can Buffers only be sent once? What is the purpose of blocking a second sending? This is probably a dumb question but I am just curious.