V
V
Vadim2014-02-22 18:10:27
Data synchronization
Vadim, 2014-02-22 18:10:27

How to implement server self-provisioning synchronization in peer-to-peer network of C# client-server application?

There is a local network. When a client appears in it, he must check whether there is a server with which he can connect, if so, he does this and waits for commands from the server. Otherwise, he himself must become a server and wait for clients to connect. It was invented that at first all clients get into a multicast group and wait for a random response time from the server. If it is not there, then they break off and start sending messages to the server themselves. The problem is that if the waiting time for two clients is approximately the same, there will be two servers that will send messages to clients. How to synchronize server allocation?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikolai Turnaviotov, 2014-02-22
@foxmuldercp

Em. I would probably listen to some broadcast address, for example, and send some request to it at startup. if in say 5 seconds the answer did not come, he would become a master. If the answer came, then I would not be the first to become a client.
read how the wins server is implemented in the Microsoft protocol of the same name.

V
Vitaly Sergeev, 2014-09-30
@enkryptor

It is possible to add an intermediate phase before assigning a server, in which the client will query the network for similar "server candidates" and, if there are any, restart the election.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question