locka99 / opcua

A client and server implementation of the OPC UA specification written in Rust
Mozilla Public License 2.0
515 stars 140 forks source link

Configurable client's secure channel Lifetime #374

Open BogdanYarotsky opened 3 months ago

BogdanYarotsky commented 3 months ago

Hello,

Here is a small PR based on the request in issue #205.

Now instead of hardcoded lifetime, the default value is passed from the client config (default is still 1 minute as it were with the previous const value so nothing is changed for existing users).

It's also now configurable using the ClientBuilder. Accepted value there is u32 and not a Duration to avoid implicit truncation of milliseconds.

I have added a few tests for a config builder but don't know how to test that the actual secure channel request is sending the right data. I would be grateful for suggestions.

In case of any questions please let me know.

Bogdan