Align client and solution with renamed projects
Update project references and solution entries to use `PipeClient` and `PipeServer`, and launch the renamed `PipeServer.exe` or `PipeServer.dll`.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System.Numerics;
|
||||
|
||||
namespace PipeShared;
|
||||
|
||||
public interface IServerMethods
|
||||
{
|
||||
int Add(int a, int b);
|
||||
Vector3 AddVector(Vector3 a, Vector3 b);
|
||||
double Divide(double a, double b);
|
||||
Task<string> EchoAsync(string text);
|
||||
Task<int> SlowOperationAsync(int delayMs, Guid operationId);
|
||||
void CancelOperation(Guid operationId);
|
||||
void Crash(int exitCode);
|
||||
}
|
||||
|
||||
public static class PipeConstants
|
||||
{
|
||||
public const string PipeNameArgPrefix = "--pipe=";
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using PipeMethodCalls;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace PipeShared;
|
||||
|
||||
/// <summary>
|
||||
/// JSON serializer that also includes public fields (required for System.Numerics.Vector3).
|
||||
/// </summary>
|
||||
public class JsonFieldsPipeSerializer : IPipeSerializer
|
||||
{
|
||||
private static readonly JsonSerializerOptions Options = new() { IncludeFields = true };
|
||||
|
||||
public object Deserialize(byte[] data, Type type) => JsonSerializer.Deserialize(data, type, Options)!;
|
||||
|
||||
public byte[] Serialize(object o) => JsonSerializer.SerializeToUtf8Bytes(o, Options);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="PipeMethodCalls" Version="4.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user