简体   繁体   中英

Notify all clients about a change

so I'm in a little project of mine and for now the client gets some information it needs using requests, more precisely requesting the data to a nodejs server running express. The thing is I want that when 1 client alters something every connected client gets a notification that something just changed. How could I do this? I'm new to all this networking stuff so any help is appreciated. Also the client is a C# Windows Forms

This sounds like it can be achieved via the publisher-subscriber design pattern. Where each client will subscribe to an event and listen to it (perform an action on it) whenever there's an event being broadcasted. I suggest you take a look atthe pattern and see how others have implemented it particularly to your situation.

You can take a look at Socket.io which is "a library that enables real-time, bidirectional and event-based communication between the browser and the server."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM