Page 2 of 2

Re: Implementation of Server-Sent Events (SSE) in ESP-IDF

Posted: Tue Feb 06, 2024 12:27 pm
by MicroController

Code: Select all

httpd_socket_send(mySocketHD, mySocketFD, sse_resp, sizeof(sse_resp), 0);
One last thing: sizeof(sse_resp) should be sizeof(sse_resp)-1 because sse_resp implicitly includes a "\0" terminator which you should not send.

Re: Implementation of Server-Sent Events (SSE) in ESP-IDF

Posted: Sat Apr 13, 2024 8:50 pm
by SirrCharles
A client example of this would be fantastic!

Re: Implementation of Server-Sent Events (SSE) in ESP-IDF

Posted: Mon Oct 06, 2025 12:57 pm
by Maximilian22

Code: Select all

httpd_socket_send(mySocketHD, mySocketFD, sse_resp, sizeof(sse_resp), 0);
One last thing: sizeof(sse_resp) should be sizeof(sse_resp)-1 because sse_resp implicitly includes a "\0" terminator which you should not send.
Of course you are right, I had overlooked that.
Thank you very much for your kind help, much appreciated!