Skip to content

Commit

Permalink
Shutdown CT for IPC
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHeart committed Aug 14, 2024
1 parent 88499d7 commit a476fee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ShockOsc/Services/Pipes/PipeServerService.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.Collections.Concurrent;
using System.IO.Pipes;
using System.IO.Pipes;
using System.Text.Json;
using Microsoft.Extensions.Logging;
using OpenShock.SDK.CSharp.Utils;
using OpenShock.ShockOsc.Utils;

Expand All @@ -10,11 +8,13 @@ namespace OpenShock.ShockOsc.Services.Pipes;
public sealed class PipeServerService
{
private readonly ILogger<PipeServerService> _logger;
private readonly IHostApplicationLifetime _appLifetime;
private uint _clientCount = 0;

public PipeServerService(ILogger<PipeServerService> logger)
public PipeServerService(ILogger<PipeServerService> logger, IHostApplicationLifetime appLifetime)
{
_logger = logger;
_appLifetime = appLifetime;
}

public string? Token { get; set; }
Expand All @@ -35,7 +35,7 @@ private async Task ServerLoop()

_logger.LogInformation("[{Id}] Starting new server loop", id);

await pipeServerStream.WaitForConnectionAsync();
await pipeServerStream.WaitForConnectionAsync(_appLifetime.ApplicationStopped);
#pragma warning disable CS4014
OsTask.Run(ServerLoop);
#pragma warning restore CS4014
Expand Down

0 comments on commit a476fee

Please sign in to comment.