Search code examples
.net-remoting

.Net Remoting - How to recover from server crash


I have looked all over the place and have never seen an example of how to do this, even tho it's alluded to in blogs. But examples are never given.

I have a .Net remoting client that is connected to a server which is published as a well known type over tcp/ip. It holds an object reference to the server and instantiates it via the new operator.

If the server crashes, the easy part is detecting this, just catch the error. Looping and waiting for the server to come back up will again be no problem.

But how to reset / reboot / unregister then re-register the remoting stack on the client?!?

If the client is restarted after the server comes back up, it works again, but obviously I want to just reconnect within the client application and not have to reboot it.


Solution

  • Windows Communication Foundation does not have the same issue. When the server goes down, the connection can be programatically re-established.