MailChimp.NET icon indicating copy to clipboard operation
MailChimp.NET copied to clipboard

How can be timeouts limits setup?

Open javihm opened this issue 11 years ago • 2 comments

http://apidocs.mailchimp.com/gettingstarted/timeouts.php

How can Stream Timeouts and Connection Timeouts limits setup?

javihm avatar Feb 04 '14 10:02 javihm

private T MakeAPICall<T>(string apiAction, object args) { ...

Action<System.Net.HttpWebRequest> actionConnectionTimeout = (System.Net.HttpWebRequest x) => x.Timeout = 1;

            //  Call the API with the passed arguments:
            var resultString = fullUrl.PostJsonToUrl(args, actionConnectionTimeout );
            results = resultString.Trim().FromJson<T>();

}

I think that with this code, you can put timeout connection to 1 milisecond to test connection timeouts.

Anybody can suggest how to prevent stream timeouts?

Maybe var resultString = fullUrl.PostJsonToUrl(args, actionConnectionTimeout ); with resultString == null?

javihm avatar Feb 05 '14 08:02 javihm

javihm, I tried that code and it didn't seem to change anything - I always got a 90 second timeout.

DDtMM avatar Aug 07 '14 13:08 DDtMM