Can I use compression to improve RMI performance when transferring large datasets between the client and server?
Answer
Yes, you should be able to use the ZipInputStream and ZipOutputStream classes within a custom socket factory to give you a new socket type that transparently compresses data.
When you construct your ServerImpl, don't use the constructor that takes the port number, use the default constructor.
so use ServerImpl server = new ServerImpl();
Registry r = LocateRegistry.createRegistry(1090);
Naming.rebind("//localhost:1090/ZipServer",server);NOT
ServerImpl server = new ServerImpl(SOME_PORT);
Registry r = LocateRegistry.createRegistry(1090);
Naming.rebind("//localhost:1090/ZipServer",server);