
/** RMIClient - from Tanenbaum [making explicit possible checked 
	exceptions]
*/

import java.rmi.*;
import java.net.*;

public class RMIClient
{
    public static void main(String[] args) {
	try {
//	    String host = "rmi://127.0.0.1/DateServer"; // i.e localhost
	    String host ="rmi://155.247.182.4/DateServer";
	    RemoteDate dateServer = (RemoteDate)Naming.lookup(host);
	    System.out.println(dateServer.getDate());
	} catch (NotBoundException e) {//This is a checked exception
	    System.err.println(e);
	} catch (MalformedURLException e) {//This is also a checked exc.
	    System.err.println(e);
	} catch (RemoteException e) {//And so is this one
	    System.err.println(e);
	}
    }
}

