Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package timeexample;
- import java.rmi.*;
- public class TimeClient {
- // MAIN
- public static void main(String[] args) {
- String host = "localhost";
- int port = 1099;
- try {
- TimeService ts = (TimeService) Naming.lookup("//" + host + ":" + port + "/" + TimeService.SERVICE_NAME);
- System.out.println(ts.getTime());
- } catch (java.net.MalformedURLException mue) {
- mue.printStackTrace();
- } catch (NotBoundException nbe) {
- nbe.printStackTrace();
- } catch (RemoteException re) {
- re.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement