Click here to Skip to main content
15,885,885 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Problem:
I have 5 PC-s where one of them is a Base and the other PC-s are Clients. All devices are controled by touch. On the Base PC we release an order with diferent articles. Each Client PC serves a specific collection of articles. By releasing a Order from the Base PC every Client PC sees the articles it serves where the users can click on each article if it is finished for deployment.

As Database we are using a SQL Server.

It is something like the PC-s in MC Donalds when they order more chees burgers ;)


My solution:
I have a SQL table with 5 rows. Every row is representing a PC and it has a boolean as value. If the boolean value is true a "event is rased" and I mark the article on the Base PC as done an save the boolean value as false. But checking that values every 2 seconds on each PC is crashing the server after a wile. Because of that we need something better than that.

Question:
How can I make a event that recognises when a Client PC has a article finished so that I can mark it as done on the Base PC? In real time.

Are there events that can be raised and recognised trough diferent machines over a base machine?
Posted
Comments
BacchusBeale 8-Apr-15 17:22pm    
The usual scenario is all client PCs ask the server/base PC for any data/articles and the server PC send the data to each client. The client would then notify or call a method to indicate they are finished. The server application should have a list of connected clients with state information. The idea to do via SQL table is not good- what if later you add more clients?
Sergey Alexandrovich Kryukov 8-Apr-15 17:56pm    
And this scenario is a total shame, no server push... Client-server architecture was a lame from the very beginning, I cannot understand why not mane were able to realize it.
—SA
BulletVictim 9-Apr-15 2:27am    
Have you thought about multithreading the check on the server?
TarikHuber 9-Apr-15 10:13am    
@BacchusBeale Something like that is going on but over a SQL server. What I realy don't like because it is a fast and very dirty solution. What can I use to call a method from the server to the clients?

@Sergey Yes. It is a shame and I want to get rid of it. But blaming me for bad code withoud giving me a solution is not bether than my SQL solution ;) Maybe you are a web developer and know only that kind of architecture.

@BulletVictim multithreading would make the clients a little bit faster but it would not prevent that the SQL Server crashes from to mutch connections or wathever it crashes it.

1 solution

Something like this could be useful:

Server: https://msdn.microsoft.com/en-us/library/fx6588te(v=vs.110).aspx[^]

Client: https://msdn.microsoft.com/en-us/library/bew39x2a(v=vs.110).aspx[^]

I just need time to implement it to the application.

UPDATE:
Sockets are the right way but a constant connection is not a good idea. So using UDP Sockets is for now the best way I can find to rais a event on a other machine in a LAN environment.

On this link is a greate example of how to use them: https://social.msdn.microsoft.com/Forums/en-US/92846ccb-fad3-469a-baf7-bb153ce2d82b/simple-udp-example-code?forum=netfxnetcom[^]

The listener I added to a background worker so the UI is still working and it is done :)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900