Original Post
I am writing a server - client application with RMI. Things are more or less running, but there are a lot of things I''m not so sure about. Here thay come.
When using UnicastRemoteObject and I create a server an instance of this, will diffrent clients be able to connect simultaniously without interfereing with each others data? If not how should this be done?
I have tried to make a remote login method on the this object that will return another Remote object, but I couldn''t make it work. I found a solution where this remote object also inherited from UnicastRemoteObject, but is this realy nessecarry?
When I have have this object, it will not be available after some time. Looks like if the garabage collector throws it away some time after it has been used for the first time. So what I did was to hava e thread holding the reference to the object. Seemed to me as a realy nasty solution...
The default for the UnicastRemoteObject is to lett a random port be made when connecting, this is not acceptable for me because I have to run this through a firewall with only special ports enabled. Prefereabely as few ports as possible (1 for RMI and one for the server, is this possible)?
I have been looking around on the net to find solution to my problems but either there are typically whitepapers of 100pages+ or there are very simple tutorials on how to make RMI server/clients. So can you please help me.
Thanks in advance.