You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been having problems sending SMS messages because of connection timeouts. It doesn't happen every time, it's just "random" (my guess just because of the network connection quality "randomness"). Looks like I've been able to fix this using a custom HttpClient with a higher connect timeout value (10 seconds):
Although this is fine for me, it would make Chat and Voice endpoints not work as addressed in #29 because the endpoints are different and setting a custom HttpClient makes the same client be used in the 3 endpoints, making this solution not perfect for everyone.
The default value for CURLOPT_CONNECTTIMEOUT seems to be 300 seconds, much higher than our 2 seconds. Other language rest API libraries for MessageBird (I've briefly looked at Java, C# and Python libraries) use their HTTP client default values which most of the times AFAIK are set to "infinite".
Having all this in count, may be the default value should be raised. Not just me, I suspect more people may be having the same issue. In that case those 2 lines should be changed and I could provide a PR:
This just hit me too, even though it seems the default timeout has changed since this issue was created.
It would be nice if there was an easier way to configure timeouts, perhaps as an extra option added into the $config array of the Client constructor, both for the connection and regular timeout.
I've been having problems sending SMS messages because of connection timeouts. It doesn't happen every time, it's just "random" (my guess just because of the network connection quality "randomness"). Looks like I've been able to fix this using a custom HttpClient with a higher connect timeout value (10 seconds):
Although this is fine for me, it would make Chat and Voice endpoints not work as addressed in #29 because the endpoints are different and setting a custom HttpClient makes the same client be used in the 3 endpoints, making this solution not perfect for everyone.
The default value for CURLOPT_CONNECTTIMEOUT seems to be 300 seconds, much higher than our 2 seconds. Other language rest API libraries for MessageBird (I've briefly looked at Java, C# and Python libraries) use their HTTP client default values which most of the times AFAIK are set to "infinite".
The last PR that set this value was #28
Having all this in count, may be the default value should be raised. Not just me, I suspect more people may be having the same issue. In that case those 2 lines should be changed and I could provide a PR:
https://github.com/messagebird/php-rest-api/blob/master/src/MessageBird/Common/HttpClient.php#L59
https://github.com/messagebird/php-rest-api/blob/master/src/MessageBird/Client.php#L147
The text was updated successfully, but these errors were encountered: