Monday 15 February 2010

java - server socket loose binding -


I want to develop master server and secondary server

when the master server is down Secondary server should come on the same port.

But when the master server is ready to start the secondary server, it should be slowed down so that the master server can start on the same port.

Is there any way secondary server knows that another process is trying to start on the same port?

If you need it always, then keep your server up always, You can follow this method,

Create a basic process, which will be born to a child, listening to the actual service on the harbor when the child is serving the actual requests, then the parent < Will wait for the child to die by using code> waitpid in C (crash / state) Change). So whenever the child goes down, the parents know and produce the new process. - Favorite Attitude .


If you need a master-secondary design specifically,

When completing a secondary request, it can always wait for the signal Master Server So when the master is finished, its first task will be to send the signal through the reach of the secondary (either via a PID file or file lock or forced failure) so that the secondary can be closed honestly.

No comments:

Post a Comment