Limenius / ReactRenderer

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

Use stream_socket_sendto and stream_socket_shutdown instead of fwrite #10

Closed jfoucher closed 7 years ago

jfoucher 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.

jfoucher commented 7 years ago

This solution doesn't work and I've found a proper workaround. See the related issue