opcua icon indicating copy to clipboard operation
opcua copied to clipboard

Does the Client/Connection send out 'events' or notify in case the status of the connection changes?

Open Wafje opened this issue 5 months ago • 0 comments

Does the Client/Connection send out 'events' in case the status of the connection changes?

The client keep track of the connection state:

const (
	// Closed, the Connection is currently closed
	Closed [ConnState](https://pkg.go.dev/github.com/gopcua/opcua#ConnState) = [iota](https://pkg.go.dev/builtin#iota)
	// Connected, the Connection is currently connected
	Connected
	// Connecting, the Connection is currently connecting to a server for the first time
	Connecting
	// Disconnected, the Connection is currently disconnected
	Disconnected
	// Reconnecting, the Connection is currently attempting to reconnect to a server it was previously connected to
	Reconnecting
)

Is there a way to get notified when the value changes?

Wafje avatar Aug 30 '24 10:08 Wafje