How to Bind Remote Object particular IP Address

S

sherazi

On my System there are two Ethernet Adapter attached. I want to bind
my remote object with particular IP address of Ethernet card .How I can
set IP address to which remote object cab be bind.

Following is the code for binding the object

systemProperties.put("java.rmi.server.hostname", serverAddress);
Registry reg =
LocateRegistry.createRegistry(Constants.RMI_REGISTRY_PORT);
reg.rebind("My Object", remoteobject);


Thanks in Advance.
 
R

Roedy Green

On my System there are two Ethernet Adapter attached. I want to bind
my remote object with particular IP address of Ethernet card .How I can
set IP address to which remote object cab be bind.

I don't understand quite what the problem is, and the answers to some
of the questions I think you may be asking are platform/router
specific.

If you want simply to find out what ip addresses are assigned to the
current machine, you can use the Java source at
http://mindprod.com/ip.html
called "WhoAmI"

In Windows you can find out such information with the IPCONFIG
utility.

In Windows you can also find out with control panel, Network and
Dialing digging in the TCP/IP protocol section. You will have to
assign a permanent IP rather than using DHCP if you want something
fixed you can talk about elsewhere on your LAN. Instead of using raw
IPs, you can assign host names in your hosts file and propagate that
around the LAN.

See http://mindprod.com/jgloss/hosts.html

If there are people coming in from the outside the LAN, you will have
to configure your router to direct them to the correct ip/port. Again
you will need fixed ips on your servers for that, in the range
192.168.0.1 .. 192.168.255.254 where 192.168.0.1 is usually the
router.

Pretty much any time you can use "http://mindprod.com" in Java you can
also use "http://24.85.32.136"
 
R

Roedy Green

He wants it to listen only on one specific IP address, rather than the
default of INADDR_ANY.

OK, I see now. I figured that part would be easy once he knew the
desired IP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top