Skip to content

Commit

Permalink
Fixed re-init ports
Browse files Browse the repository at this point in the history
  • Loading branch information
HakanL committed May 29, 2024
1 parent 625082a commit 8686a0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Haukcode.sACN/Haukcode.sACN.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<ItemGroup>
<PackageReference Include="Haukcode.Network" Version="1.0.10" />
<PackageReference Include="System.Net.NetworkInformation" Version="4.3.0" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
</ItemGroup>

</Project>
6 changes: 4 additions & 2 deletions src/Haukcode.sACN/SACNClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,12 @@ private async Task Sender()
{
while (!this.shutdownCTS.IsCancellationRequested)
{
var sendData = this.sendQueue.Take(this.shutdownCTS.Token);
SendData sendData = null;

try
{
sendData = this.sendQueue.Take(this.shutdownCTS.Token);

if (sendData.AgeMS > 100)
{
// Old, discard
Expand Down Expand Up @@ -316,7 +318,7 @@ private async Task Sender()
finally
{
// Return to pool
sendData.Data.Dispose();
sendData?.Data?.Dispose();
}
}
}
Expand Down

0 comments on commit 8686a0c

Please sign in to comment.