javascript - Node.js TCP server incoming buffer -
i have 2 node processes speak each other. call them [node server] , [node sender] . [node sender] continually processes information , writes message on tcp connection [node server] . [node server] writes status message. example of [node sender]: var message = "test message"; [node sender].connection.write(message); example of [node server]: [node server].socket.on("data", function(p_data) { this.write("ok"); // work p_data } this works without issue, p_data contains "test message" when sent @ above 5 milliseconds. however, if speed [node sender] write every millisecond, p_data ends "test messagetest messagetes" . i understand buffer in [node sender] filling faster write command sending it. there way force one-to-one ratio in sending messages while still remaining asynchronous? i can add terminator message , fill buffer in [node server] , wanted make sure there wasn't obvious missing. ...