Hi all, I want to ask for the SCJD assignment, multiple clients are expected. So if I start the RMI server on IP 192.168.0.2 on port 1234 for example. First client choose this server and port 1234 - connects fine. Second client choose sam server but port 1235. When this 2nd client runs client app, it gets java.rmi.ConnectException because the currently started server on ip 192.168.0.2 is with port 1234 and not 1235. What do people do in this case? Also what about if client choose a new IP which server isn't running, java.rmi.ConnectException will prompt.
Ideally I should send a "remote command" to that IP and say start the server. But how to send remote command? I can't call the server code on the client computer because the IP is different.
I see some people use "rmi://server_ip:port/filename", but when is this used and where?
All clients should connect on the same port.
If the port is not configured ok for a client, just show to the user that there's no server listening on that port (maybe tell him to try again, or to check if there's any server running on the machine he's trying to connect to).
You don't have to start anything if the client is not wise enough to enter the correct numbers.