Open PeterPann23 opened 2 years ago
That doesn’t solve the issue I have, better is add a strong named CID that both client and server can agree on and is unique to both
Was this every done? - I have 2 apps on the same machine sending to the server - which is OK for the message as I can put the app in it but I can't monitor the disconnect connect as I don't get which app - I can send a message on connect but I can't monitor disconnect
When establishing a connection it would be nice if one could add client metadata to the connection like a Connection Identifier (CID). At the moment it's hard to identify a client connection on the server side. At the moment we make this part of the message but if the server gets a client message and needs to "send updates to a specific other" connected client then having a CID would be good.
await using var client = new PipeClient(pipeName) {
ClientMeta = new ClientMeta() { MachineName=Enviroment.MachineName, Role="MyRole", ...}
};
One could add the CID in the server connection handshake, the service already maintains a state for connected clients
When implementing something like this, you could do:
await server.ConnectedClients.Where(w=>s.MetaData.Role=="SomeRole").SendMsgAsync(..)