rmi over the net

ive got a simple text editor to work over a LAN using RMI, how do i get it to work over the internet?

Set the IP to connect to, to the IP you wish to connect to. :smiley:

im using the computers name to connect not the IP what would i have to change, im assuming its this line of code in the client:

server = (EditorInterface)Naming.lookup( REGISTRY + SERVICE );

REGISTRY and SERVICE are Strings, Registry is simply the computers name “//piii800/”

thanks .

If you are using an RMI registry to rondeyvous then what you need is a well known public RMI registry accessible from the net…

Your problem is that you appear to be using windows networking to locate your computer instead of the hostname.

You probably don’t have a hostname.

You’ll probably need to learn all about NAT to make this work, since you need the hostname of a machine on the internet somewhere, and most home users don’t have that functionality out of the box.

could it be my ports? I’ve forwarded the default rmi port 1099 is that all thats needed? or are there more i need to open?

otherewise is there a simple example program that works over the net that i could look at somewhere?

thanks.

Ah…did you ever stop doing this?

yeah I changed the name to its 192.168 IP address and that works across the network ( is that what you meant?) but when it come to trying it across the internet with its router Ip address forwarded im not getting much luck. Any suggestions would be greatly appreciated. Thanks

First, check that the port forwarding is working as expected by running a packet sniffer (e.g. ethereal) on the local machine to see if it ever receives the packets on port 1099.

Second, run the packet sniffer when connecting over the local LAN to see if RMI is sending packets to any other ports that you may also need to forward from the router.

Third, check that you haven’t got any additional firewalls anywhere, or on the router, that are blocking the port even though it’s being forwarded.

routers will not foward any 192.168.x.x packets across the internet, you need to use the public ip address of the router which is fowarding those ports to connnect