Skip to content

Commit

Permalink
examples: use correct close method
Browse files Browse the repository at this point in the history
  • Loading branch information
magiconair committed Jan 27, 2022
1 parent e3a606e commit 17436a2
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples/accesslevel/accesslevel.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func main() {
if err := c.Connect(ctx); err != nil {
log.Fatal(err)
}
defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

id, err := ua.ParseNodeID(*nodeID)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion examples/browse/browse.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func main() {
if err := c.Connect(ctx); err != nil {
log.Fatal(err)
}
defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

id, err := ua.ParseNodeID(*nodeID)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion examples/crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func main() {
if err := c.Connect(ctx); err != nil {
log.Fatal(err)
}
defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

// Use our connection (read the server's time)
v, err := c.Node(ua.NewNumericNodeID(0, 2258)).ValueWithContext(ctx)
Expand Down
2 changes: 1 addition & 1 deletion examples/datetime/datetime.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func main() {
if err := c.Connect(ctx); err != nil {
log.Fatal(err)
}
defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

v, err := c.Node(ua.NewNumericNodeID(0, 2258)).ValueWithContext(ctx)
switch {
Expand Down
2 changes: 1 addition & 1 deletion examples/history-read/history-read.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func main() {
if err := c.Connect(ctx); err != nil {
log.Fatal(err)
}
defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

id, err := ua.ParseNodeID(*nodeID)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion examples/method/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func main() {
if err := c.Connect(ctx); err != nil {
log.Fatal(err)
}
defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

in := int64(12)
req := &ua.CallMethodRequest{
Expand Down
2 changes: 1 addition & 1 deletion examples/monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func main() {
log.Fatal(err)
}

defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

m, err := monitor.NewNodeMonitor(c)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion examples/read/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func main() {
if err := c.Connect(ctx); err != nil {
log.Fatal(err)
}
defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

id, err := ua.ParseNodeID(*nodeID)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion examples/regread/regread.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func main() {
if err := c.Connect(ctx); err != nil {
log.Fatal(err)
}
defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

id, err := ua.ParseNodeID(*nodeID)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion examples/subscribe/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func main() {
if err := c.Connect(ctx); err != nil {
log.Fatal(err)
}
defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

notifyCh := make(chan *opcua.PublishNotificationData)

Expand Down
2 changes: 1 addition & 1 deletion examples/translate/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func main() {
if err := c.Connect(ctx); err != nil {
log.Fatal(err)
}
defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

root := c.Node(ua.NewTwoByteNodeID(id.ObjectsFolder))
nodeID, err := root.TranslateBrowsePathInNamespaceToNodeIDWithContext(ctx, uint16(*ns), *nodePath)
Expand Down
2 changes: 1 addition & 1 deletion examples/trigger/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func main() {
if err := c.Connect(ctx); err != nil {
log.Fatal(err)
}
defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

notifyCh := make(chan *opcua.PublishNotificationData)

Expand Down
2 changes: 1 addition & 1 deletion examples/udt/udt.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func main() {
if err := c.Connect(ctx); err != nil {
log.Fatal(err)
}
defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

v, err := c.Node(id).ValueWithContext(ctx)
switch {
Expand Down
2 changes: 1 addition & 1 deletion examples/write/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func main() {
if err := c.Connect(ctx); err != nil {
log.Fatal(err)
}
defer c.CloseSessionWithContext(ctx)
defer c.CloseWithContext(ctx)

id, err := ua.ParseNodeID(*nodeID)
if err != nil {
Expand Down

0 comments on commit 17436a2

Please sign in to comment.