RMI Callbacks

Need to check a premise here, to provide an object that a server can callback on to client the client most open a server socket on which the client side object will be exposed?

If this is true it makes it totally irritating from a game point of view since the player will have to open their firewall to get the traffic in… icky icky icky

Kev

God! It’s been so loooong…but I did some searching, and found these links:

http://www.cssassociates.com/rmifirewall.html
and
http://www.jguru.com/faq/view.jsp?EID=997
and
http://ca.geocities.com/rmi_doves/

Interesting idea that is described in the thread: Implement a SocketFactory that will force rmi callback communication over a single (client initiated) connection instead of the default way which is to use a new connection from the server. This way the NAT can be applied properly using the connection initiated by a client. I think if you don’t go this route, there’s just no way (aside from making some complicated router/firewall modifications) that you can get what you want.

Of course, there is some problems with timeout issues and such, but i i think these can be handled.

-Chris

RMI is usefull only on LAN, so firewalls shouldn’t be a problem.

RMI is perfectly usable across the internet. I’ve used it for Highscore tables a few times. Just calling back that irritates.

Re: SocketFactory implementation. Seems to be possible just over complicated for me. I’ve just bailed and put a home rolled TCP layer in there.

Kev

We use RMI extensively over the internet at work. In fact we don’t even do it directly, it’s all tunneled over HTTPS through a Tomcat servlet.

Callbacks are impossible in this situation anyway. If you want to simulate them however, you can get the client to open an RMI call in a separate thread that only returns when the server has some message to give back to it (at which point it returns, punts the message off to some processor, and then calls the server again
immediately to listen for more messages).

We will be implementing this functionality at work soon so we can inform users of an impending server shutdown.

Cas :slight_smile:

if it’s just for sending an highscore table , a simple tcp server/client is prolly less hassle than trying to change RMI socket factory

Actually in this case its not.

But wrt to Highscore tables, actually a RMI server is way easier than raw TCP. Once you’ve used it a bit RMI really is increadibly simple.

Kev

You might take a look to the prototype of jnag at http://jnag.dev.java.net

The lib is still in early development, however I am trying to make the life of programmers easier, so if you have some suggestions about what a RMI-like library should do that RMI doesn’t, please post a message on the RFE forum of the project.

Thank you :slight_smile: