+/EE360P

distributed systems

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

vijaygarg1init2227200

master
666 B20 linesraw
1package name;
2import java.net.*;
3public class NameRmiClient {
4    public static void main(String args[]) {
5        try {
6            NameService r = (NameService) 
7                           java.rmi.Naming.lookup("rmi://mario.ece.utexas.edu/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}