diff --git a/Client/Program.cs b/Client/Program.cs index fe5cb9d..b53e89a 100644 --- a/Client/Program.cs +++ b/Client/Program.cs @@ -13,7 +13,7 @@ Log("Client started."); string pipeName = $"PipeDemo-{Environment.ProcessId}-{Guid.NewGuid():N}"; Process? serverProcess = null; -PipeClient client = null!; +PipeClient client = null!; try { @@ -154,7 +154,7 @@ async Task StartServerAndConnectAsync(string pipeName) }; serverProcess = process; - client = new PipeClient(new JsonFieldsPipeSerializer(), pipeName); + client = new PipeClient(new JsonFieldsPipeSerializer(), pipeName); using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); await client.ConnectAsync(cts.Token); } diff --git a/Server/Program.cs b/Server/Program.cs index f08e1ad..f94db88 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -9,10 +9,10 @@ Console.WriteLine($"Server started. Pipe: {pipeName}"); // Exceptions in handler methods are caught by PipeMethodCalls and sent to the client // (client receives PipeInvokeFailedException with the server exception details). -var server = new PipeServer( +var server = new PipeServer( new JsonFieldsPipeSerializer(), pipeName, - () => new Calculator()); + () => new ServerMethods()); await server.WaitForConnectionAsync(); Console.WriteLine("Client connected."); diff --git a/Server/Calculator.cs b/Server/ServerMethods.cs similarity index 93% rename from Server/Calculator.cs rename to Server/ServerMethods.cs index 2ae8928..0a3df13 100644 --- a/Server/Calculator.cs +++ b/Server/ServerMethods.cs @@ -1,10 +1,10 @@ -using System.Collections.Concurrent; +using ClientServerShared; +using System.Collections.Concurrent; using System.Numerics; -using ClientServerShared; namespace Server; -public class Calculator : ICalculator +public class ServerMethods : IServerMethods { public int Add(int a, int b) => a + b; diff --git a/Shared/ICalculator.cs b/Shared/IServerMethods.cs similarity index 93% rename from Shared/ICalculator.cs rename to Shared/IServerMethods.cs index a8c547c..53f9699 100644 --- a/Shared/ICalculator.cs +++ b/Shared/IServerMethods.cs @@ -2,7 +2,7 @@ using System.Numerics; namespace ClientServerShared; -public interface ICalculator +public interface IServerMethods { int Add(int a, int b); Vector3 AddVector(Vector3 a, Vector3 b);