Eureka !
I think I fixed it, I'll try to explain clearly.
Symptoms :
At this point, you can rule out any software issues and start searching at a lower level.
After a little googling, I found this page : https://technet.microsoft.com/en-us/library/dd349797%28v=ws.10%29.aspx.
WARNING : always backup your registry before playing with it !
I checked my registry, none of those values were event there, so I added them and... everything started working perfectly and immediately.
I'm convinced that, there is absolutely no software explanation for not receiving any data from Twitter, the documentation is clear, they'll always, at least, send a linefeed every 30 seconds.
Thus, if you stop receiving data without catching any exception (missing, falling behind, quotas etc.), the problem must come from somewhere else at a lower level (TCP, network, hardware etc.).
I really hope this could help and save time.
I think I fixed it, I'll try to explain clearly.
Symptoms :
- Create a stream
- Start listening
- Messages start to arrive
- Slowly, the number of received messages from Twitter (even the linefeeds which are supposed to keep the connection alive) decreases
-
Finally, nothing comes back from Twitter
- Once your stream is created, be sure to catch all possible events from Twitter (for debugging purpose, use a filter you'll be sure to catch a lot of data, i.e. track=twitter)
- Applies @linvi's very elegant solution with the timer to be sure your code is as robust as possible
- Try, if you can, to execute your code on many different machines, different configurations (OS, network, provider etc.)
- Grab the Windows version of curl (with SSH), and use it to test your stream outside of your code (I use Twitter oAuth tool to generate curl request, check at the end of this page https://dev.twitter.com/streaming/reference/post/statuses/filter for instance).
-
Check Twitter API Status (but what are the odds the problem could come from there ?)
At this point, you can rule out any software issues and start searching at a lower level.
After a little googling, I found this page : https://technet.microsoft.com/en-us/library/dd349797%28v=ws.10%29.aspx.
WARNING : always backup your registry before playing with it !
I checked my registry, none of those values were event there, so I added them and... everything started working perfectly and immediately.
I'm convinced that, there is absolutely no software explanation for not receiving any data from Twitter, the documentation is clear, they'll always, at least, send a linefeed every 30 seconds.
Thus, if you stop receiving data without catching any exception (missing, falling behind, quotas etc.), the problem must come from somewhere else at a lower level (TCP, network, hardware etc.).
I really hope this could help and save time.