Receiving a reply #68
-
Is h.pipes only for one way communication? I have set up h.pipes to send a message, pipe.SendAsync("Open window") which makes a window open in another process. Easy to setup and works really well, thank you. However, I can't see any examples or tests that I could use along the lines of: Then in the server code something like: string QuestionReceived(string msg) I have previously done something similar with windows remoting but need to send a msg from a .NET 6 64bit process to a .NET 4.8 32bit process so windows remoting is not possible. I have seen your IPC project which looks like it allows return values but was hoping stick with h.pipes without need to use a common interface. (Although I guess the interface could simply be one function of string Message(string msg); ) Are there any code examples of how to achieve this kind of two way communication with h.pipes or do I need to use h.IPC? p.s. I'm not very experienced in this space so I may be way off the mark and misunderstanding what pipes are used for. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Server.ClientConnected += async (o, args) =>
{
Clients.Add(args.Connection.PipeName);
UpdateClientList();
AddLine($"{args.Connection.PipeName} connected!");
try
{
await args.Connection.WriteAsync("Welcome! You are now connected to the server.").ConfigureAwait(false);
}
catch (Exception exception)
{
OnExceptionOccurred(exception);
}
}; await Server.WriteAsync(textBoxMessage.Text).ConfigureAwait(false); https://github.com/HavenDV/H.Pipes/blob/master/src/samples/WindowsFormsApp |
Beta Was this translation helpful? Give feedback.
I got my project working with https://github.com/HavenDV/H.Ipc.
Works really well. Thank you Konstantin!!