Recommended timeout


I’m using the C# client library to consume a stream (Nick Halstead’s Google Employees stream if it matters).

I left the config settings as per the sample application:

config.Timeout = 20000;
config.AutoReconnect = true;
config.MaxRetries = 10;

However, my application only ran for ~5 minutes until a DatasiftStreamException was thrown (The connection to the DatasiftStream timed out). 20 seconds seems very long, but it is not long enough.

I have increased the timeout to 60 seconds, and it has now been running for over an hour, but it remains to be seen if this is enough.

My application needs to run 24/7, and whilst I am happy to have long timeouts and retries, this doesn’t seem right.

My question is, what is the recommended timeout?


The recommended timeouts have been built into each of our Official API Client Libraries. Details of the recommended timeouts can be found on our Reconnecting page.


It looks as though these reconnect rules are already built into the C# client so I don’t have to implement them myself?

I’ve tried running the application again with a 20 sec timeout but the DatasiftStreamException (The connection to the DatasiftStream timed out) was thrown before 10 minutes has elapsed.

As I said earlier, the application must run 24/7, so the DatasiftStreamException must not go uncaught.

I could set MaxRetries to a large number, or If I could catch the DatasiftStreamException from the DatasiftStream thread, then I could restart myself.

Increasing MaxRetries is obviously easiest, but what do you advise?


We have applied a bug fix to the C# API Client Library, making changes to the way exceptions and stopping streams are handled. Thank you for raising this xibis