saving ref of remote object
i need to connect to N servers and give them tasks, and after X seconds im checking each one of them if they finished.
so i tried to save the ref to the remote object in a hashTable (as the key), but when im trying to remove an item in the hashTable(after he finished his job) im getting a runtime exception ("Request for premission of type System.runtime.remoting.objref failed" ).
how to get to each server?
thanks in advanced
[459 byte] By [
ppl1] at [2008-2-26]
You dont have the object just a proxy.
Why not use async remoting? There are a number of ways, delegates, async callbacks, or remotely delegatable objects (events) which would suit your needs much better and are very easy to implement.
im new to the remoting thing so i dont know how to use all that possibilities...
can you give me an example or just direct me to an article/example?
Asynchronous remoting - just like any other asynchronous programming - is making a request on an object and providing a callback to be called when the object has completed it's task. A quick search on
asynchronous remoting example yields several good results for example of asynchronous remoting.
To handle multiple servers just makes requests to several object instances. Provided with a callback the remote object - so long as two-way communication is possible (using either the TcpChannel, the new IpcChannel, or some third-party channel; HttpChannel is only one-way) - the remote object will call your callback when completed. Then you don't have to poll to see when the service is complete.