File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
55and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
66
7+ ## [ 2.2.2] - 2023-09-20
8+ ### Fixed
9+ - Missing NetworkStream lock.
10+
711## [ 2.2.1] - 2023-08-01
812### Fixed
913- IDisposable implementation.
Original file line number Diff line number Diff line change @@ -68,11 +68,20 @@ public override void Open()
6868 public override void Close ( ) =>
6969 _tcpClient . Dispose ( ) ;
7070
71- public override IDisposable Lock ( ) => new DisposableLock ( ) ;
71+ public override IDisposable Lock ( ) => new NetworkStreamLock ( this ) ;
7272
73- private class DisposableLock : IDisposable
73+ private class NetworkStreamLock : IDisposable
7474 {
75- public void Dispose ( ) { }
75+ NetworkStream _networkStream ;
76+
77+ public NetworkStreamLock ( NetworkStream networkStream )
78+ {
79+ _networkStream = networkStream ;
80+ Monitor . Enter ( _networkStream ) ;
81+ }
82+
83+ public void Dispose ( ) =>
84+ Monitor . Exit ( _networkStream ) ;
7685 }
7786 }
7887}
Original file line number Diff line number Diff line change 1212 <RepositoryType >git</RepositoryType >
1313 <PackageTags >modbus;client</PackageTags >
1414 <PackageReleaseNotes >Fixed
15- - IDisposable implementation </PackageReleaseNotes >
15+ - Missing NetworkStream lock. </PackageReleaseNotes >
1616 <PackageLicenseExpression >MIT</PackageLicenseExpression >
17- <VersionPrefix >2.2.1 </VersionPrefix >
17+ <VersionPrefix >2.2.2 </VersionPrefix >
1818 </PropertyGroup >
1919
2020 <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='Debug|AnyCPU'" >
You can’t perform that action at this time.
0 commit comments