Nodejs: Set highWaterMark of socket object

后端 未结 2 838
情话喂你
情话喂你 2020-12-19 16:04

is it possible to set the highWaterMark of a socket object after it was created:

var http = require(\'http\');

var server = http.createServer();

server.on(         


        
2条回答
  •  有刺的猬
    2020-12-19 16:13

    You don't need to. Incoming data will almost certainly be split across two or more reads: this is the nature of TCP and there is nothing you can do about it. Fiddling with obscure socket parameters certainly won't change it. And the data will be lit but certainly not corrupted. Just treat the socket as what it is: a byte stream.

提交回复
热议问题