By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

RMI Callback; reusing established client to server connection (workaround firewall / NAT)

P: n/a

Hello all,

I'm pretty new to the Java newsgroups so I apologize for dropping this
into several maybe offtopic groups. I'm sorry!

So on to my problem... I've come to a point in our RMI application where
I need to have server callbacks to the client RMI applications. I've
used the technique where the client passes an UnicastRemoteObject of
itself to a RMI server method that registers the clientinterface object
in a Vector. Now when I do this register in my home LAN all works fine
(callback methods are working), but when I connect from the office to my
home server the connection stalls at the point of the registermethod
with the callback object as parameter. No exceptions are thrown, the
client just freezes but the server keeps running just fine...

I then found several connection attepts from my home-server's IP to our
firewall/NAT router at the office originating from the clients RMI
SSL-connection assigned port. This makes me assume that the callback
technique in turn opens a new socket from server to client in stead of
just reusing the established connection.

Am I right or is my code missing something to prevent the extra
connection? And if I am right has anyone found a solution other than to
not use RMI and write to sockets directly?

--
Regards,

Jo Voordeckers
Imagine-IT.BE

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Jo Voordeckers" <jo*****@imagine-it.be> wrote in message
news:3f***********************@reader0.news.skynet .be...

Hello all,

I'm pretty new to the Java newsgroups so I apologize for dropping this
into several maybe offtopic groups. I'm sorry!

So on to my problem... I've come to a point in our RMI application where
I need to have server callbacks to the client RMI applications. I've
used the technique where the client passes an UnicastRemoteObject of
itself to a RMI server method that registers the clientinterface object
in a Vector. Now when I do this register in my home LAN all works fine
(callback methods are working), but when I connect from the office to my
home server the connection stalls at the point of the registermethod
with the callback object as parameter. No exceptions are thrown, the
client just freezes but the server keeps running just fine...

I then found several connection attepts from my home-server's IP to our
firewall/NAT router at the office originating from the clients RMI
SSL-connection assigned port. This makes me assume that the callback
technique in turn opens a new socket from server to client in stead of
just reusing the established connection.
Your assumption is correct. RMI tries to open new sockets on the client side
if you use callbacks.
Am I right or is my code missing something to prevent the extra
connection? And if I am right has anyone found a solution other than to
not use RMI and write to sockets directly?


There is no solution based on RMI. Your client is hidden behind a firewall.
Callbacks do not work across firewalls. See
http://java.sun.com/j2se/1.4.2/docs/...l#firewallBoth

Consider using application-level proxy (described in the same source).

Alex Molochnikov
Gestalt Corporation

Jul 17 '05 #2

P: n/a
EJP


Alex Molochnikov wrote:

"Jo Voordeckers" <jo*****@imagine-it.be> wrote in message

There is no solution based on RMI. Your client is hidden behind a firewall.
Callbacks do not work across firewalls. See
http://java.sun.com/j2se/1.4.2/docs/...l#firewallBoth

Consider using application-level proxy (described in the same source).

See http://www.rmiproxy.com
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.