Replace ICalculator with IServerMethods
Rename the server implementation and update client/server pipes to use the shared server-methods interface. Move PipeConstants alongside it and log “Client started.” during client startup.
This commit is contained in:
+2
-2
@@ -13,7 +13,7 @@ Log("Client started.");
|
||||
string pipeName = $"PipeDemo-{Environment.ProcessId}-{Guid.NewGuid():N}";
|
||||
|
||||
Process? serverProcess = null;
|
||||
PipeClient<ICalculator> client = null!;
|
||||
PipeClient<IServerMethods> client = null!;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -154,7 +154,7 @@ async Task StartServerAndConnectAsync(string pipeName)
|
||||
};
|
||||
serverProcess = process;
|
||||
|
||||
client = new PipeClient<ICalculator>(new JsonFieldsPipeSerializer(), pipeName);
|
||||
client = new PipeClient<IServerMethods>(new JsonFieldsPipeSerializer(), pipeName);
|
||||
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
|
||||
await client.ConnectAsync(cts.Token);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user