.Net remoting: Reactivating proxy object
-
Hello, (This applies to C# as well) I am building a tool using .Net remoting. If I obtain a proxy by Activator.GetObject and then want to switch that proxy by calling Activator.GetObject again with a different parameter - and I do this on a separate thread than the thread(s) that is/are using that proxy, could I run in to trouble? Right now I am using a SyncLock, but there could be several threads using this object, so each one has to wait its turn - even though the server code can handle several asynchronous calls just fine. Could I remove the SyncLocks with no worries? If you need a little more explanation: There will be several servers in different locations running the server code via a Windows service. These services may go down, start up, stop working, etc., so my client code may need to switch where it gets the proxy from. I have a separate thread that monitors these servers and tries to maintain the best connection. I want to know if there is a problem if a thread starts using the proxy, and then the connection thread switches the proxy. I assumed there was a problem so I used SyncLocks, which is also causing problems, so if possible, I want to remove the SyncLocks. Thanks, Kevin