Ping (IsAlive) between two WCF windows Services
Posted on 2013-01-02
I am looking to communicate between two Services (rather two instances of the same service) on two different servers. InstanceB should periodically check if InstanceA is alive.
These services are producing services and not consuming services. Both instances would be running at the same time, but only InstanceA would be producing the needed values. Only if InstanceA fails, would InstanceB takeover.
I'm thinking of taking the 'IsAlive' approach where InstanceB checks if InstanceA is alive every 10 seconds. I've added an IsAlive() method to my contract. Since both the Instances would be Identical, how would my code to call the IsAlive() method or config file have to change?
I would appreciate a code sample.
Thanks in advance!