I haven't never studied protocol details of RMI and i don't have time for it now, so i hope that someone could help me..
I have RMI server (or is it register..) in remote host. There is two firewall between client&server. If i take telnet from client to server in RMI port, it accept connection, so connection work in that way, but client firewall don't accept incoming connections. What can i do?
I can use RMI fine in other machine, where there isn't any firewalls between this server host and client host.
I will use one RMI method, which i will call in client, and method will return byte array.
Why RMI works this way? If client create socket to server, and it is bidirectional TCP socket, why cannot RMI read inputstream, or does it work other way? is RMI ?
The problem is that RMI will use a variety of ports to 'talk' between the client and server after the initial connection is established. Here is a tutorial on using a custom socket factory to fix this. You could also implement RMI-HTTP Tunneling. Firewall issues in general are covered in the RMI FAQ on Sun's site under the heading 'Firewall Issues'.
However, if you just have one method and it returns a byte array, why not just use a direct socket connection?
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Artsi, If it is possible to open a port in the firewall, for RMI communication, then your "server" object (which probably extends UnicastRemoteObject) should override the "UnicastRemoteObject(int)" constructor. See the javadocs for more details.
Good Luck, Avi.
Let's go to the waterfront with this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java