Professional Documents
Culture Documents
LAb Assignment 3 FEB-2018
LAb Assignment 3 FEB-2018
Assignment 3 – Lab 3
i) Compile the following codes separately and run the RMI server
and then RMI client.
ii) Look for the output. change the coding for different port number
iii) Does you client responds? If not analyze the program.
import java.rmi.*;
import java.rmi.*;
import java.rmi.registry.*;
import java.rmi.server.*;
import java.net.*;
catch(Exception e){
System.out.println("can't get inet address.");
}
int port=3232;
System.out.println("this address=" + address + ",port=" + port);
try{
registry = LocateRegistry.createRegistry(port);
registry.rebind("rmiServer", this);
}
catch(RemoteException e){
System.out.println("remote exception"+ e);
}
}
static public void main(String args[]){
try{
RmiServer server = new RmiServer();
}
catch (Exception e){
e.printStackTrace();
System.exit(1);
}
}
}
import java.rmi.*;
import java.rmi.registry.*;
import java.net.*;