I need to build a "fault recovery" web service on a Win 2K server box. The
fault recovery is provided for a server process which runs on a Linux box.
Whenever this server process goes down, the fault-recovery web service will
have anywhere between 500 to 1000 hits within 1 to 3 seconds for fault
recovery services, from clients who were connected to the server which went
down.
Now, what I do in the recovery process is that I talk to a daemon process on
the Linux box and try to restart the server process there. The communication
between the Linux box and the web service is done through TCP sockets.
The problem is that I don't wan't all the 500 ~ 1000 requests coming in, to
talk to the Linux box and try to restart the server process. I want only one
of those requests to do this, and all others to wait until the server has
been restarted.
I can't use a simple lock on a variable for this, since all 500 ~ 1000
requests will be on different app-domains, and so that kind of a lock would
not work.
Any suggestions are appreciated.
Ashwin Kambli