Named Pipe IPC: Protocols & Status Codes
I'm basically starting from scratch with my implementation, since I've gone way too deep with my initial approach and need something that I can actually finally work with.
I'm writing an IPC implementation via named pipes. I'm open to other ideas (I don't know if anonymous pipes are appropriate here), but named pipes are definitely what I've settled on.
I cannot use additional NuGet packages and I'm on .NET Standard 2.0 (C# 13, PolySharp).
My requirements are the following:
I will have multiple server implementations. Each server fulfills a different purpose and has multiple methods (I will call them endpoints) pertaining to that purpose.
A server endpoint can be the equivalent to one of these:
Each server will be paired up with a client implementation that should simplify calling server endpoints for the user. These clients should return some
My idea was to send data via JSON. The client serializes the request; sends it to the server; the server deserializes the data and calls the corresponding endpoint implementation. I'm not sure how to handle figuring out this correspondence.
I'm looking for some ideas on how to implement this in a manner that is reasonably robust and can be extended to more server-client-pairs without many problems.
I'm writing an IPC implementation via named pipes. I'm open to other ideas (I don't know if anonymous pipes are appropriate here), but named pipes are definitely what I've settled on.
I cannot use additional NuGet packages and I'm on .NET Standard 2.0 (C# 13, PolySharp).
My requirements are the following:
I will have multiple server implementations. Each server fulfills a different purpose and has multiple methods (I will call them endpoints) pertaining to that purpose.
A server endpoint can be the equivalent to one of these:
Action, Action<T>, Func<TResult>, Func<T, TResult>. To clarify; an endpoint can optionally receive some request data, and can optionally return some response data.Each server will be paired up with a client implementation that should simplify calling server endpoints for the user. These clients should return some
Result type to signal success or failure. If the server responds with a failure, the kind should be communicated to the client. This includes unhandled server exceptions.My idea was to send data via JSON. The client serializes the request; sends it to the server; the server deserializes the data and calls the corresponding endpoint implementation. I'm not sure how to handle figuring out this correspondence.
I'm looking for some ideas on how to implement this in a manner that is reasonably robust and can be extended to more server-client-pairs without many problems.