I'm trying to accomplish some form of redirection of messages in .NET Remoting.
As you can see in the image I would like for the client to send a message to the provider (which is the only URI that the client has to know about), which will then redirect this to host1. Here's the tricky part; the provider will keep track of which host is alive (by exposing a register/unregister remoting-method to the hosts), in other words the provider has to be able to dynamically change which URI it should redirect the message to.
I have been attempting to solve the problem by creating a host in the provider that the client sends messages to, and then a client (in the provider) that implements a custom proxy (by inheriting from RealProxy) that will redirect messages to the currently preferred host. However, I keep coming back to the problem about dynamically changing URI and I get the feeling that I'm just missing some easy, but vital, part that will solve this problem without turning it into a big hairy monster.
Any tips/hints will be much appreciated!