Skip to content

Commit

Permalink
Fix for PollSocket method, thank you @zllvm @Energiz0r @Espen-Kalhage…
Browse files Browse the repository at this point in the history
  • Loading branch information
jchristn committed Jan 18, 2023
1 parent cf21b27 commit 825c017
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

## Current Version

v3.0.6
v3.0.7

- Add ```NoDelay``` to settings (thank you @huangjia2107)
- Fix for PollSocket method, thank you @zllvm @Energiz0r @Espen-Kalhagen-Element-Logic

## Previous Versions

v3.0.6

- Add ```NoDelay``` to settings (thank you @huangjia2107)

v3.0.5

- Merge fix from @ATS-CE
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ SuperSimpleTcp provides simple methods for creating your own TCP-based sockets a
- More configurability around certificate validation checks (thank you @ATS-CE)
- Better catch client timeouts during TLS establishment (thank you @ATS-CE)
- Add ```NoDelay``` to settings (thank you @huangjia2107)
- Fix for PollSocket method, thank you @zllvm @Energiz0r @Espen-Kalhagen-Element-Logic

## Special Thanks

Expand All @@ -28,7 +29,7 @@ A special thanks to the community of people that have contributed to or otherwis
@tinohager @u1035 @cmeeren @pha3z @opnop @kopkarmecoindo @simonhaines @matt1tk
@lukeacat @exergist @maynardsi @sector13371 @loganwoodxyz @jwfxpr @IanPNewson
@EGirardi @redrabbit007 @eatyouroats @joreg @CetinOzdil @tautvilis @ATS-CE
@TheNybbler @huangjia2107
@TheNybbler @huangjia2107 @zllvm @Energiz0r @Espen-Kalhagen-Element-Logic

## Help or Feedback

Expand Down
7 changes: 6 additions & 1 deletion src/SuperSimpleTcp/SimpleTcpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,12 @@ private bool PollSocket()
var clientSentData = _client.Client.Receive(buff, SocketFlags.Peek) != 0;
return clientSentData; //False here though Poll() succeeded means we had a disconnect!
}
catch (SocketException)
catch (SocketException ex)
{
Logger?.Invoke($"{_header}poll socket from {ServerIpPort} failed with ex = {ex}");
return ex.SocketErrorCode == SocketError.TimedOut;
}
catch (Exception)
{
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/SuperSimpleTcp/SuperSimpleTcp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netstandard2.0;netstandard2.1;net461;net48;net5.0;net6.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>3.0.6</Version>
<PackageReleaseNotes>Add NoDelay to settings (thank you @huangjia2107)</PackageReleaseNotes>
<Version>3.0.7</Version>
<PackageReleaseNotes>Fix for PollSocket method, thank you @zllvm @Energiz0r @Espen-Kalhagen-Element-Logic</PackageReleaseNotes>
<Authors>Joel Christner</Authors>
<Description>Simple wrapper for TCP client and server in C# with SSL support</Description>
<Copyright>(c)2023 Joel Christner</Copyright>
Expand Down

0 comments on commit 825c017

Please sign in to comment.