public void connect() throws RemoteException {

        try {
            registry = LocateRegistry.getRegistry(ipAddress, portNumber);
        } catch (RemoteException ex) {
            System.out.println("Client: Cannot locate registry");
            System.out.println("Client: RemoteException: " + ex.getMessage());
            registry = null;
        }
        if (registry != null) {
        } else {
            System.out.println("Client: Cannot locate registry");
            System.out.println("Client: Registry is null pointer");
        }

        if (registry != null) {

            try {
                ieffect = (IEffectenbeurs) registry.lookup(bindingName);
            } catch (RemoteException | NotBoundException ex) {
                ieffect = null;
            }

            if (ieffect != null) {
            } else {
                System.out.println("Client: Effectenbeur is null pointer");
            }

        }
    }