Hi, my question is not strictly streaming api related, thank to the mods to move this post if necessary.
I’m (french and) working on my own streaming api that is served by a nodejs server. It is very similar to twitter streaming api: response is sent as a very long file and whenever no event has to be sent empty lines are used to maintain connection alive.
My problem is I can’t detect whenever remote connections drop brutally. It uselly happens when network channel between clients and the server has gone down.
I could use tcp keepalive mecanism but I’ve read that this is not what twitter does (“connection” header is set to “close” on twitter streaming packets). It seems twitter is using data structures that keep track of packets that have been sent. Those data structures can tell whenever remote clients read data.
Since there is no ping/pong mecanism on streaming api’s application layer protocol, how is this working? Can i reproduce it with my nodejs server?
Thanks for reading and sorry for my poor english.