Any way to implement server side events ?

Considering a remote web server, is there any way to use the app as a client using SSE to receive data?

SSE

1 Like

I’m not familiar with SSE, but UE has build-in support for TCP & UDP sockets, HTTP client(but not the server) and JSON support. So, if you really need this, you can use those to implement any network protocol you like

I know about these features, some of them are in Ufna’s plugin and I use that, but this is something else. I don’t how else could be implemented to get asynchronous messages from the server.

@BestWarrior Did you ever find a solution for this? I’m also just now looking in a way to subscribe to and process a server sent event stream.

Do you still need this?

I implemented one using libcurl in a really dodgy way. Essentially you spawn another thread to listen on the sse connection, receives sse data in chunks and pass them to a threadsafe queue (I think the UE Provided queue). The game thread dequeues chunks from this queue and porcceses the chunks back into legible events and consumes them as events.

You process chunks into events based on delimiters, like in my use case it was \n\n to mark the end of an event.

If you need help I can write on and put on github, otherwise good luck! Ask me if you want help (:

@shreeep Hey, I found another solution for the moment. Thankyou anyway!