S
S
superivankorolev2016-06-13 06:56:20
JavaScript
superivankorolev, 2016-06-13 06:56:20

Why doesn't socket.write on the client write immediately?

I am using TLS.
There is an array of data. I send it to the server with some time delay.
I need the "data" event to immediately fire on the server.
And so for some reason he sends it for the first time as I expect. Then it somehow cunningly glues the data, and the code is already the last socket.write is called, the data goes to the server. And the server immediately starts catching a lot of "data" events.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Philipp, 2016-06-13
@superivankorolev

socket.setNoDelay(true)
Disables the Nagle algorithm .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question