Benefits of reusing proxy?
- From: "Joel Lyons" <joellNO_SPAM@xxxxxxxxxxx>
- Date: Wed, 3 Jan 2007 17:38:52 -0700
I have a method (call it DoRemoteWork) that performs a remoting call to
another (always the same) machine. This method could be called very
frequently in some scenarios. Is there any benefit to creating a proxy to
the remote object once and then reusing the proxy for every call versus just
creating the proxy within this method right before every call (which would
result in multiple proxies existing to service multiple threads, I guess).
ie, is the first below better than the second?
IServer _proxy;
void DoRemoteWork() {
if(_proxy == null)
_proxy = //create proxy
_proxy.Work();
}
void DoRemoteWork() {
IServer proxy = //create proxy
proxy.Work();
}
.
- Prev by Date: Receiving notification from Singleton after the client crash
- Next by Date: Remoting Service Crash on Win2k but not on WinXP???
- Previous by thread: Receiving notification from Singleton after the client crash
- Next by thread: Remoting Service Crash on Win2k but not on WinXP???
- Index(es):