Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1.  
  2.  
  3. import java.rmi.*;
  4. import java.rmi.registry.*;
  5. import java.io.*;
  6.  
  7. public class Client {
  8. public static void main(String args[]) throws Exception {
  9.  
  10. try{
  11.  
  12.  
  13.  
  14. System.setProperty("java.rmi.server.hostname","192.168.1.107");
  15.  
  16. Registry reg = LocateRegistry.getRegistry("192.168.1.107",1098);
  17. String name = "value";
  18. RmiServerIntf obj = (RmiServerIntf) reg.lookup(name);
  19. fw.write(obj.getMessage());
  20. obj.writeMessage("JR");
  21. fw.write(obj.getMessage());
  22. fw.close();
  23. } catch(Exception e) {
  24. System.out.println(e);
  25. }
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement