Added NrxDebugVisualizer, not working
This commit is contained in:
@@ -3,6 +3,7 @@ using PipeMethodCalls;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NamedPipes;
|
||||
@@ -30,15 +31,15 @@ public partial class NamedPipesServer(string pipeName,Action<string>? logger = n
|
||||
Logger("Waiting for client connection...");
|
||||
await PipeServer.WaitForConnectionAsync().ConfigureAwait(true);
|
||||
}
|
||||
public async Task RunAsync()
|
||||
public async Task RunAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
while(true)
|
||||
while(!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
await WaitForConnectionAsync().ConfigureAwait(true);
|
||||
Logger("Client connected.");
|
||||
while (IsConnected)
|
||||
{
|
||||
await Task.Delay(100).ConfigureAwait(true);
|
||||
await Task.Delay(100, cancellationToken).ConfigureAwait(true);
|
||||
}
|
||||
Logger("Client disconnected.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user