Using stream_socket_sendto and stream_socket_shutdown allows for receiving arbitrary amounts of data on the nodeJS side and then sending the response on the "finish" event. Otherwise, for large amounts of data, the data is truncated if the response is sent in the "data" event, or if it if moved to the 'end' or 'finish' events, these are never called.
Using stream_socket_sendto and stream_socket_shutdown allows for receiving arbitrary amounts of data on the nodeJS side and then sending the response on the "finish" event. Otherwise, for large amounts of data, the data is truncated if the response is sent in the "data" event, or if it if moved to the 'end' or 'finish' events, these are never called.