简体   繁体   中英

C# WCF multiple clients

I have made a WCF service that make changes to SQL database.

There is one client connected, that have one listbox showing data from that database.

Also, in the client app, there is one textbox and one button. With button click, string from textbox is added to database and to listbox also.

But when I connect multiple clients, only client that make changes can see them in listbox.

When I reopen some other client again, that newly made string are added to listbox.

How can I have those changes in all client's listboxes in realtime?

You will have to create a duplex communication contract, so that the server can send messages to connected clients.

For example: A-Beginners-Guide-to-Duplex-WCF

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