locka99 / opcua

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

check if client connection is successfull #147

Closed schroeder- closed 2 years ago

schroeder- commented 2 years ago

Currently it is possible that Client connect_to_endpoint and connect_to_endpoint_id can fail and still return a session. See: https://github.com/locka99/opcua/blob/89ea484783038f96448822c095c2b3acf4bb6719/client/src/client.rs#L218-L228.

You get the error only when you try to use any service. I think i would be better to return every error from connect_to_endpoint and connect_to_endpoint_id. Or at least give a possibility to check if the session is successful established, with out using a service. This would simplify the client logic.

locka99 commented 2 years ago

That line should probably return an Err(). I'll keep bug open until it's fixed

locka99 commented 2 years ago

Fixed, function will return an error status code if the connection failed, not a session