+/EE360P

distributed systems

git clone https://git.julia.blue/+/EE360P

vijaygarg1included dependenciesde0e46f

master
737 B20 linesraw
1import java.net.*;
2public class NameRmiClient {
3    public static void main(String args[]) {
4        try {
5            NameService r = (NameService) 
6                           //java.rmi.Naming.lookup("rmi://mario.ece.utexas.edu/MyNameServer");
7                           java.rmi.Naming.lookup("rmi://localhost/MyNameServer");
8            if (r == null) 
9               System.out.println("Could not find the service.");
10            else {
11               r.insert("p1", "tick.ece", 2058);
12               InetSocketAddress entry = r.search("p1");
13               if (entry != null)
14                  System.out.println(entry.toString());
15            }
16        } catch (Exception e) {
17            System.out.println(e);
18        }
19    }
20}