Skip to content

Commit

Permalink
- CS 104 Connection: only call CLOSED event when running set to false
Browse files Browse the repository at this point in the history
  • Loading branch information
mzillgith committed Apr 25, 2019
1 parent 6ece46b commit 0112878
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions lib60870/CS104/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1714,6 +1714,8 @@ private void HandleConnection()
{
}

running = false;

socket.Close();

netStream.Dispose();
Expand Down Expand Up @@ -1747,6 +1749,10 @@ private void HandleConnection()
connecting = false;
}

/// <summary>
/// Gets a value indicating whether this <see cref="T:lib60870.CS104.Connection"/> is running(connected).
/// </summary>
/// <value><c>true</c> if is running/connected; otherwise, <c>false</c>.</value>
public bool IsRunning
{
get
Expand Down
2 changes: 1 addition & 1 deletion lib60870/LibraryCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class LibraryCommon
/// <summary>
/// Library minor version number
/// </summary>
public const int VERSION_MINOR = 1;
public const int VERSION_MINOR = 2;

/// <summary>
/// Library patch number
Expand Down
7 changes: 7 additions & 0 deletions lib60870/lib60870.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit.3.11.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.11.0\build\NUnit.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand Down Expand Up @@ -31,6 +32,9 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.11.0\lib\net40\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down Expand Up @@ -103,4 +107,7 @@
<Folder Include="CS104\" />
<Folder Include="LinkLayer\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
3 changes: 0 additions & 3 deletions tests/lib60870-tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
<Reference Include="nunit.framework, Version=2.6.4.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
<Package>nunit</Package>
</Reference>
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb">
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Test.cs" />
Expand Down

0 comments on commit 0112878

Please sign in to comment.