I want my server to call client and not vice versa. what we call it a Call back. when we have our conventional RMI "hello world" application we have a Server object which implements a Remote interface and that is binded in the RMI registry which the client looks up. what happens when a Server wants to excecute a method that is on the client. how many remote objects do I need to make and how many do I need to bind. If some one could just give me an example(as a hello world type) I would be more then happy
I have tried a simple example for RMI callback. But it does not work if the client is an Applet running in a browser. The problem is when the client creates a Remote object (which is a UnicastRemoteObject) my hostname is encodes in the object rather than the IP address. Therefor when the server tries to invoke a method on it, the following error is generated: java.net.SocketException: connect (code=10061) If I use an application for my client (or run my Applet in the appletviewer), IP is encoded in the remote object and everything works. Any suggestion helps? Thanks, Arsalan
Joined: Apr 07, 2000
Arsalan , will you have a look at Jason Hunters code from Java Servlet PRogramming . He has used a better way of doing it Look at chapter 10 Applet Servlet Commn..