travisjeffery / TRVSEventSource

Server-sent events EventSource client using NSURLSession

Home Page:http://twitter.com/travisjeffery

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Return http status code if event source failed

archer-fengjiang opened this issue · comments

We are using this client for long running streaming data. (2000 messages per sec). And a lot of times event source failed with error set to be nil. Sometimes it is due to authentication failure to establish streaming. Sometime server restarts and connection is broken. Sometimes it is due to time out. Sometimes server closes the connection with a http status code.

So a lot of time we want to know what is causing the failure. So that we can either reconnect, or re-authenticate, or just let it fail. It would be super nice to have http status code returned in the failure callback so we have more info to determine what is going wrong.