Skip to content

Commit

Permalink
Merge pull request #116 from libplctag/#115
Browse files Browse the repository at this point in the history
Implemented fixes according to #115
  • Loading branch information
timyhac committed Jan 6, 2021
2 parents 3a33588 + 2dd628c commit 0e905e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libplctag/Tag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public async Task InitializeAsync(CancellationToken token = default)
else
tagHandle = result;

using (token.Register(() => Abort()))
using (cts.Token.Register(() => Abort()))
{
while (GetStatus() == Status.Pending)
{
Expand Down Expand Up @@ -342,7 +342,7 @@ public async Task ReadAsync(CancellationToken token = default)
cts.CancelAfter(Timeout);
var status = (Status)plctag.plc_tag_read(tagHandle, 0);

using (token.Register(() => Abort()))
using (cts.Token.Register(() => Abort()))
{
while (status == Status.Pending)
{
Expand Down Expand Up @@ -382,7 +382,7 @@ public async Task WriteAsync(CancellationToken token = default)
cts.CancelAfter(Timeout);
var status = (Status)plctag.plc_tag_write(tagHandle, 0);

using (token.Register(() => Abort()))
using (cts.Token.Register(() => Abort()))
{
while (status == Status.Pending)
{
Expand Down

0 comments on commit 0e905e4

Please sign in to comment.