-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support context.Timeout during Connection initiation. #138
Comments
Oops! That's an unpleasant oversight. |
If you want, I can send a PR with the relevant changes. |
I'd be happy to accept it, thanks. I started looking at it yesterday, and the right way to do it would be to modify the base signatures of the functions to include the context as the first parameter. However, that would break backward compatibility (though that's not necessarily a reason to not do it). A usual method of getting around that is to just create a new function with the Context prefix (e.g. BUT, the real problem here is that the underlying websocket dial doesn't use context for its cancellation; it needs to have an explicit timeout declared in its configuration struct. Now, we could derive that from our context's deadline, but that would conflate the retries mechanism, which I don't much like. So, I think it would generally be better to NOT use |
I agree with you there. The way I am doing it now is by creating a |
Presently, the
native.Connect
doesn't have a mechanism for timeouts. This gives rise to situations where the connection hangs for ever.Can be re-created easily with wrong
address
orport
during establishing connection.Asterisk Version: 18 LTS.
The text was updated successfully, but these errors were encountered: