nauful / LibUA

Open-source OPC UA client and server library
Apache License 2.0
262 stars 94 forks source link

After disconnecting a client, the result is always BadNotConnected #10

Closed Ttberg closed 4 years ago

Ttberg commented 4 years ago

The title says it all, after opening a secure channel with security Policy set to none to get the endpoints, I disconnect the client but always get a BadNotConnected as a return value. I was expecting after a successful disconnect to receive the Good result.

nauful commented 4 years ago

This is a design choice to keep the return value of any UA calls as the current server state. Different UA servers have many compatibility workarounds, and the most common denominator is to simply close the socket. Sending a close message is to just hint that the server doesn't need to keep around client-specific information (such as subscriptions) preserved if the client reconnects.