Skip to content
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

How to customize the connection timeout? #27

Open
amsyrena opened this issue May 19, 2023 · 1 comment
Open

How to customize the connection timeout? #27

amsyrena opened this issue May 19, 2023 · 1 comment

Comments

@amsyrena
Copy link

amsyrena commented May 19, 2023

I want to customize the connection timeout, how should I do it?
One way that comes to my mind is to update the value of A_PROCESSING_TIME in constants.py. But how to update the value of A_PROCESSING_TIME in constants.py?

Thank you very much for providing this library, it is very useful!

@jacobschaer
Copy link
Owner

It's been a while since I looked at this, but most of the functions accept a timeout parameter, which is exposed to the udsoncan client and should make use of any request timeouts you set there. The only exception I think is _connect which is needed for establishing the initial socket.

If the issue you're having is in _connect, I imagine you could just monkeypatch it - might need to experiment with the import name you overwrite, but surely it can set externally. Not elegant but should get you started. I can imagine there probably exists some bad ECU somewhere that doesn't respect the rules or, perhaps, there's a gateway in the middle which is slow.

Ideally those would be class members that are override-able by the constructor or config dicts like udsoncan uses, but at the time it seemed like a bit of a nuisance to implement and test, and the spec called them out as constants so I just went with that.

If you would like to refactor to make that override-able by the constructor, feel free to MR and I can take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants