K. Tsang wrote:Hi all, I have a question. Is multithreading build into RMI already? Do I need to cater for this specifically on my RMI server? I asked this because once I get my RMI server running, I don't seem to get any output to the console when clients connect like printing "there are x clients connected". Thanks
Hi,
I'm not sure I understand entirely your question.. Let me try to go trough a sequential scenario:
- You start your RMI Registry;
- You start your server;
- You bind an Object from your server into the Registry (this will be the Remote object);
- You start several clients;
- Several clients can get a reference to your remote object from the RMI Registry;
- Multiple threads will be started/used by the RMI runtime upon concurrent call of a method on the remote object;
- It is up to RMI to reuse a
Thread or create a new one when a request is made (and ultimately destroy it).
Does this helps ?
Alex