Limenius / ReactRenderer

Client and Server-side React rendering from PHP
MIT License
238 stars 37 forks source link

Use stream_socket_sendto and stream_socket_shutdown instead of fwrite #13

Closed mmuckermann-c24 closed 7 years ago

mmuckermann-c24 commented 7 years ago

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.

nacmartin commented 7 years ago

Thanks @mmuckermann-c24 !