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

MicroController
Posts: 2669
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

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

Postby MicroController » Tue Feb 06, 2024 12:27 pm

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.

SirrCharles
Posts: 3
Joined: Sun Jun 04, 2017 4:39 am

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

Postby SirrCharles » Sat Apr 13, 2024 8:50 pm

A client example of this would be fantastic!

Maximilian22
Posts: 9
Joined: Mon Jan 29, 2024 11:58 am

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

Postby Maximilian22 » Mon Oct 06, 2025 12:57 pm

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!

Who is online

Users browsing this forum: Amazon [Bot], Applebot, Qwantbot and 3 guests