Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

rmi and firewall  RSS feed

 
Arto Pastinen
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

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 ?

Thanks already!

- Artsi
[ April 08, 2005: Message edited by: Nathan Pruett ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!