Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ---------------- POŁĄCZENIE Z SERWEREM --------------------------------
- public void ConnectToServer(String ip_adress, String port) {
- server = null;
- boolean error = false;
- try {
- remote = Naming.lookup("rmi://" + ip_adress + ":" + port + "/" + "ArchiverServer");
- } catch (MalformedURLException e) {
- firePropertyChange("Connection error", 0, 1);
- error = true;
- e.printStackTrace();
- } catch (RemoteException e) {
- firePropertyChange("Connection error", 0, 1);
- error = true;
- e.printStackTrace();
- } catch (NotBoundException e) {
- firePropertyChange("Connection error", 0, 1);
- error = true;
- e.printStackTrace();
- }
- if (remote instanceof RemoteInterface)
- server = (RemoteInterface) remote;
- if(error == false)
- firePropertyChange("Connection good", 0, 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement