I am using ZetaIpc between a desktop application (.Net 5) and a Windows Server (.Net 5) on the same machine. The desktop client is the "IPC Server" and the Windows Service is the "IPC Client". The idea is when a new message comes into the service, it notifies the desktop app that a new message has arrived.
The service receives messages async. and calls a Received Message Handler when a new message comes in. I write the message to a database, then kick off a client SEND to let the desktop application know a message has arrived.
If both the desktop app and service are running everything is fine. If I stop the Desktop application, the service seems to stop at the call to sending a new message notification -- even with a timeout of 100 ms. set.
applog.Debug($"BEFORE NEW MSG NOTIFY-{_msg.messageUniqueID}");
SendNewMessageNotification($"{_msg.messageUniqueID};{_msg.messageBody}");
applog.Debug($"AFTER NEW MSG NOTIFY-{_msg.messageUniqueID}");
I have this code in the location here I call out to send the message notification. It logs before and after...and you can see this is the actual file.
You can see that when I close the desktop app, we never return from the SendNewMessageNotification method.
Here's the code where I instance the client:
//- Configure New Message Notification Client
_ipcClient = new IpcClient();
_ipcClient.Initialize(56455, 100);
...and here the code where I send the notification:
private void SendNewMessageNotification(string NewMessageData)
{
_ipcClient.Send(NewMessageData);
applog.Debug($"Send new message notification: {NewMessageData}");
}
-Joe