Anyone ever played with the idea of redirecting remoting method calls to another server using a custom proxy? I'd really appreciate any thoughs, not to say relative URL pointers. :bigyello:
Printable View
Anyone ever played with the idea of redirecting remoting method calls to another server using a custom proxy? I'd really appreciate any thoughs, not to say relative URL pointers. :bigyello:
When you say redirecting remoting method calls to another server, you mean apposed to the default remoting server or the local machine?
I haven't found may good articles online for remoting, although it's been a while since I've looked. MS press's VB.NET cookbook has a very usefull chapter on it though. I'd be more than happy to answer any question you have as well.
The idea is this: the remoting server starts up and clients begin calling Singleton objects. Instead of simply allowing the remoting infrastructure to control the object creation on the remoting server, I'd like to be able to force the object creation elsewhere.Quote:
Originally Posted by -TPM-
Hmm ok, interesting idea. I'd probably have the initial server pass back the proxy config for the next server, then have the client connect directly to the second server. Make sence?
Guess not - the client would need to know about what happens and I have to avoid that.
Why would the client need to know? You'd do it all in code at runtime.
The only other way I can think of knowing where it's being created would be to create another proxy at the server, but that wouldn't seem worth while..
Why exactly do you want to set where the object is created? For load balancing?
I was refering to the client's need to know that it would be redirected so it would connect to the next server. I want to pass a method call to another system but I don't want to change client code. This will be configurable as new object instantiations or method calls may be redirected to other servers.
Ok so you mean you don't want to change the client application.
Well I don't see a problem with creating a proxy from the main server to another remote object on another server and passing the request on. Of course it won't be as efficient as if you where directly connecting.
That's what I'm searching for. How would you do that?Quote:
Originally Posted by -TPM-
You'd just setup a client connection on the server, it shouldn't be any different than any other connection...
You can use the same method to pass events to clients.
I see what you mean. That would involve changing the code every time I needed to redirect an instantiation. As I said, this is going to be configurable so changing the server code is out.
Perhaps I didn't explain properly what I have in mind. By "proxy" I'm refering to custom proxying an object with a class that inherits from RealProxy. Using a realproxy scheme, you can control object instantiation and method invokation but without writing/changing anything on the classes that are used to instantiate remoting objects.
Why would you need to change the server code?
You just want to log the calls and pass them to other servers right?
Maybe I'm just being dumb.... :)
Maybe it's me :bigyello:. Can you explain how you'd proceed about passing the method calls to another server in more detail?
ok well something like this:
client calls method
server1 logs call
server1 looks in a config file, DB, array set by an admin app. for the server (say server2) that handles that method.
server1 then sets up a connection and passes method call on to server2.
So you're saying that the response would pass to the client through the same sink it made the call...yeah, that would do it :). I didn't get it at first, so it was me after all. :D
:) Maybe I just wasn't explaining it very well....
Just in case you did get what I ment about the client I'll explain it the same way:
client call's the logging method and passes an id for the method they need
server1 looks up the server that handles it (same way) passes back the connection details
client connects directly to server2 and calls the method
I'd say if you can that this way would probably be a better aproach, depending on the number of different servers you have.