Skip to content

Functions for Server Sent Events added - #1054

Open
IHni3 wants to merge 12 commits into
pistacheio:masterfrom
IHni3:feature/sse-functions
Open

Functions for Server Sent Events added#1054
IHni3 wants to merge 12 commits into
pistacheio:masterfrom
IHni3:feature/sse-functions

Conversation

@IHni3

@IHni3 IHni3 commented Apr 20, 2022

Copy link
Copy Markdown

Like described in #1040. I added isOpened() and isClosed(), so it is possible to know when the client terminates the connection. I personaly use it for SSE.

@dennisjenkins75

Copy link
Copy Markdown
Collaborator

I would really prefer if pistache did not use select() to poll a descriptor, and instead used the HUP event from epoll() to detect when the http client hangs up.

Comment thread tests/streaming_test.cc
// https://stackoverflow.com/questions/6624667/can-i-use-libcurls-curlopt-writefunction-with-a-c11-lambda-expression#14720398
auto curl_callback = +[](void* ptr, size_t size, size_t nmemb,
typedef size_t (*CURL_WRITEFUNCTION_PTR)(void*, size_t, size_t, void*);
auto curl_callback = [](void* ptr, size_t size, size_t nmemb,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed?

@fleon-psi

Copy link
Copy Markdown

Hi, Option to support SSEs seems to be very useful for my project.
I wanted to ask about status of this fix? Is there something I could do to help in going forward with this one?
Thanks!

@kiplingw

Copy link
Copy Markdown
Member

Thanks @fleon-psi for checking in. This PR still needs some more. It needs to at least be rebased and a unit test added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants