Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server Sent Events with AFNetworking

Has anyone managed to get Server-Sent-Events (SSE) working nicely through AFNetworking? I know AFURLConnectionOperation has an inputStream property I can attach to, but the architecture of AFNetworking seems to be oriented around receiving a response, so I'm not sure what the best way to go about it would be.

Any on how to structure such a program would be appreciated. I'm also open to other iOS libraries, if they provide cleaner solutions.

like image 870
elsurudo Avatar asked Jul 15 '13 18:07

elsurudo


People also ask

How are servers sent events?

Sending events from the server The server-side script that sends events needs to respond using the MIME type text/event-stream . Each notification is sent as a block of text terminated by a pair of newlines. For details on the format of the event stream, see Event stream format.

What are server-sent events in Javascript?

A server-sent event is when a web page automatically gets updates from a server. This was also possible before, but the web page would have to ask if any updates were available. With server-sent events, the updates come automatically.

What is SSE in network?

Security Services Edge (SSE) According to Gartner, SSE is a collection of integrated, cloud-centric security capabilities that facilitates safe access to websites, software-as-a-service (SaaS) applications and private applications.


1 Answers

AFRocketClient (built on top of AFNetworking 2.0) contains AFEventSource which is an implementation of the W3C Event Source API.

The combination of Server Side Events and JSON Patch is being referred to as Rocket.

like image 111
Robert Atkins Avatar answered Oct 18 '22 09:10

Robert Atkins