mg_http_printf_chunk() and connection buffer content #3309
-
| Hello. Using mg_http_printf_chunk() on timer (1s) to send some logs to browser. Every log is a simple JSON string. Time to time browser throws an error in JSON.parse() and something like this can be seen in DevTools panel: | 
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
| I answered this in previous questions: HTTP runs over TCP. That's the way TCP works. | 
Beta Was this translation helpful? Give feedback.
I answered this in previous questions: HTTP runs over TCP. That's the way TCP works.
However, I don't see why your data would stay unsent for 1s, nor why you are doing things that way. A stream transport protocol is for sending streams, if you need to send messages then use a messaging protocol. WebSocket, for example.
Anyway, I don't see why there can be a 1s delay in there unless you are not doing things right or have a poor wireless connection.