Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. public static RMIInter verificaLookup() { //função que verifica lookup, ou seja, o cliente fica à procura de um server para comunicar
  2. RMIInter verifica = null;
  3. try{
  4. while(true) {
  5. System.out.println("kek3");
  6. verifica = (RMIInter) Naming.lookup("rmi://localhost:7000/benfica");//"rmi://localhost:7000/benfica"
  7. try {
  8. if (verifica.test()) {
  9. break;
  10. }
  11. }catch(RemoteException re){
  12. System.out.println("kek remote");
  13. //re.printStackTrace();
  14. continue;
  15. }
  16. }
  17.  
  18. }catch(Exception e){
  19. System.out.println("Exception in main: " + e);
  20. //e.printStackTrace(); /*imprime tudo o que é da exceção, depois tirar*/
  21. }
  22. return verifica;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement