> > I think you'll find that it's the other way around, the client has established
> > that connection to the server.
[quoted text clipped - 18 lines]
> As long as the server socket factories are all null or equal according
> to their Object.equals() method this will work.
> I have several questions from what you said:
> 1- connection client/rmiregistry is on port 4000, but what determines
> the port used for connection client/server_application? Is it
> necessarily the same, the port used by the client for looking up
> (4000)?
1.1 If you specify a non-zero port to UnicastRemoteObject.super() or
UnicastRemoteObject.exportObject() when exporting your remote object, it
will use that port.
1.2 If you specify zero and there is already a remote object (such as
the Registry) running inside the JVM with compatible or null server
socket factories, it will reuse that port.
1.3. Otherwise RMI will tell the system to choose an arbitary port
number, exactly as for new ServerSocket(0) or ServerSocket.bind(null).
> 2- what is the difference between starting the rmiregistry with
> 'rmiregistry 4000' in a separate shell window and starting it, as you
> say, from within the server JVM using
> LocateRegistry.createRegistry(4000)
If it's inside the server JVM, it has the JVM's classpath; it can be
unexported; and it dies with the JVM. Apart from that, no difference at all.
BTW why are you using port 4000 for the Registry? Port 1099 is reserved
for the RMI Registry by IANA: you should be able to use that.
> 3- I didn' know that the export of server object with the 'bind'
> command could be parametrized with a port number. If this port number
> is not given (my case) what is the default behaviour?
See 1.x above.
> 4- I'm not aware at all of what you talk about server socket factories:
> 'As long as the server socket factories are all null or equal according
> to their Object.equals() method method this will work'
> Where are these factories defined, how do I access them, and get their
> state?
See java.rmi.server.RMIServerSocketFactory. If you don't specify these
yourself, they are all null and therefore equal & compatible as per 1.x
above, and you can ignore this qualification completely.
> About connection direction:
> It is not netstat which indicates the direction of the connection, as
> you can imagine from the dump, buth my client uses what he calls
> 'access list' to monitor the connections between servers of the
> platform; from this access list system they got the direction of the
> connection, but I'll get more information about that.
Get them to run netstat at the client. If it doesn't show 33041
LISTENING then the other tool is wrong.