Skip to content

Commit

Permalink
fix: Race condition within BacnetAsyncResult #50
Browse files Browse the repository at this point in the history
  • Loading branch information
gralin committed Oct 27, 2019
1 parent 9f48f6b commit c8d2efc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions BacnetAsyncResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class BacnetAsyncResult : IAsyncResult, IDisposable
private readonly int _transmitLength;
private readonly bool _waitForTransmit;
private readonly TimeSpan _transmitTimeout;
private ManualResetEvent _waitHandle;
private ManualResetEvent _waitHandle = new ManualResetEvent(false);

public bool Segmented { get; private set; }
public byte[] Result { get; private set; }
Expand Down Expand Up @@ -48,7 +48,6 @@ public BacnetAsyncResult(BacnetClient comm, BacnetAddress adr, byte invokeId,
_comm.OnReject += OnReject;
_comm.OnSimpleAck += OnSimpleAck;
_comm.OnSegment += OnSegment;
_waitHandle = new ManualResetEvent(false);
}

public BacnetAsyncResult Send()
Expand Down

0 comments on commit c8d2efc

Please sign in to comment.