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