-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Is cpprestsdk supports SSE #838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What is SSE? |
SSE is Server Sent Event. |
No plans to do anything like that at present. |
Hi ... I was able to implement Server Sent Event(SSE) using proposed solution in Issue 11. Code Snippet:
We can now keep writing on buffer whenever there is data, and calling "rwbuf.sync().wait();" will flush all data to http connection. I am able to receive data on client side. Connection will close from server only when we call "rwbuf.close(std::ios_base::out).wait();" It is possible that http connection can be closed from client side , in that case how to determine on server side whether underlying connection is still active before writing on buffer. Can you please suggest a way to determine whether underlying http connection is still open or not before writing in buffer. I have tried to see the producer_consumer_buffer and basic_istream class members, but did not get any parameter, function which can be used to determine the connection status. |
Write to the buffer and deal with the consequences of failure. Just because the connection exists before you try to do that write doesn't mean it exists halfway through your send attempt. (Having only just inherited ownership of Cpprestsdk myself I'm not really sure of the best way to achieve what you're looking to do) |
Thanks BillyONeal for your time. |
That code is not in Cpprestsdk. For the WinHTTP backend, we delegate to WinHTTP, for the WinRT backend, we delegate to WinRT, and for the asio backend, we delegate to asio. This is a platform abstraction layer and an asynchronous programming tech demo from several years ago, not a full HTTP stack. |
Is cpprestsdk supports SSE. If no, then any plan to add support in future.
We are planning to use it for chat like application where on data from client can be broadcast to all connected client using SSE.
Can this be accomplish with current SDK.
The text was updated successfully, but these errors were encountered: