-
Notifications
You must be signed in to change notification settings - Fork 165
Closed
Description
Hi,
My case: launcher application that is able to spawn 2 child apps. I want my launcher and child apps be able to talk to each other via json rpc, meaning sending multiple messages back and forth when needed. Based on od cond sampes I implemented it this way:
- Launcher creates a server based on InOut NamedPipeServerStream with name "Parent"
- Launcher starts child app
- child app creates InOut server with generated name
- child creates NamedPipeClientStream to "Parent"
- child calls remote procedure on parent "ChildReady" with generated name as paramter
- Parent creates NPCS with child's name
- parent and child send messages to each other via respecitve Client streams
- server streams get recreated after each precessed message (via while (true) loops)
while (true)
{
var stream = new NamedPipeServerStream("StreamJsonRpcSamplePipe", PipeDirection.InOut, NamedPipeServerStream.MaxAllowedServerInstances, PipeTransmissionMode.Byte, PipeOptions.Asynchronous);
await stream.WaitForConnectionAsync();
var jsonRpc = JsonRpc.Attach(stream, this);
await jsonRpc.Completion;
}is that the way to go for this case?
Metadata
Metadata
Assignees
Labels
No labels