diff --git a/client.go b/client.go index fe045ff2..968aae45 100644 --- a/client.go +++ b/client.go @@ -600,6 +600,7 @@ func (c *Client) CloseWithContext(ctx context.Context) error { } if c.SecureChannel() != nil { c.SecureChannel().Close() + c.setSecureChannel(nil) } // https://github.com/gopcua/opcua/pull/462 diff --git a/uatest/stats_test.go b/uatest/stats_test.go index 89bd3468..cdebbfe5 100644 --- a/uatest/stats_test.go +++ b/uatest/stats_test.go @@ -45,7 +45,7 @@ func TestStats(t *testing.T) { "Send": newExpVarInt(2), "Close": newExpVarInt(1), "CloseSession": newExpVarInt(2), - "SecureChannel": newExpVarInt(2), + "SecureChannel": newExpVarInt(3), "Session": newExpVarInt(4), "State": newExpVarInt(0), }