This content has been marked as final. Show 8 replies
It's not clear what you're asking here. A thread can only do one thing at a time. If you want to lookup multiple RMI Registries, or call multiple remote methods on multiple remote servers, or even add a to b, all at the same time, you have to use threads. It has nothing to do with RMI at all.
I am trying to create many connections simultaneously with many servers that have different ip addresses.
that's what i am trying to do. contacting different 'rmiregistry' 's at the same time.
it is not about threads.
is this possible?
Do you mean that each thread should contain its own Naming.lookup ?
Does this mean that the different Naming.lookup requests cannot be done in the main thread, before creating the other different threads?
You can do all the Naming.lookups first in the main thread.
In which case I have no idea what you were asking in the first place.
Well, i tried the different Naming.lookup in the main thread, but that didn't work. that was a nobound., the first connexion with 10.0.0.1 was created, but the second connexion to 10.0.0.2 didn't work.
Nobound.Exception, it didn't recognize the name of the second server. i think that this is because it was looking for the name of the second server in the rmiregistry of the 1st machine (10.0.0.1).
Are you sure that this is possible?? it didn't work for me...
NotBoundException means that there was nothing in that registry by that name. It does not mean that it looked in the wrong registry. Nothing to do with threading or parallelism whatsoever.
And there are no connections in RMI.
so, if i conclude:
"connecting" to multiple registries in the same time is possible for a single Rmi client. i'll retry, may be another thing was wrong.
This is the code i used, i post it another time:
InterfaceRMI slaves= new InterfaceRMI; (interfaceRMI is the name of the interface)
Does this code, theoretically, enable "talking" to the RMIregistries in the PC's with the IP addresses going from 10.0.0.1 to 10.0.0.5. ??
So, if I concludeYou can't conclude that without completely ignoring what I have just told you, that there are no connections in RMI, and no 'in the same time' in anything without using threads.
"connecting" to multiple registries in the same time
in the same time is possible for a single Rmi client. i'll retry, may be another thing was wrong.Yes.
Does this code, theoretically, enable "talking" to the RMIregistries in the PC's with the IP addresses going from 10.0.0.1 to 10.0.0.5. ?
thanks you. I'll retry to run this code to find out what caused the NoBound Exception. I hope i 'll find the problem..