Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static RMIInter verificaLookup() { //função que verifica lookup, ou seja, o cliente fica à procura de um server para comunicar
- RMIInter verifica = null;
- try{
- while(true) {
- System.out.println("kek3");
- verifica = (RMIInter) Naming.lookup("rmi://localhost:7000/benfica");//"rmi://localhost:7000/benfica"
- try {
- if (verifica.test()) {
- break;
- }
- }catch(RemoteException re){
- System.out.println("kek remote");
- //re.printStackTrace();
- continue;
- }
- }
- }catch(Exception e){
- System.out.println("Exception in main: " + e);
- //e.printStackTrace(); /*imprime tudo o que é da exceção, depois tirar*/
- }
- return verifica;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement