IP address of Server

Hi All

I want to get the ipaddress of the wmServer running my service.

Thanking you in anticipation

Write a Java service. Use the java.net.InetAddress class.

Hi guys - I thought I’d post a quirk I’ve seen with WM and IP addresses.

Over here, we run IS servers on machines with multiple IP addresses. We tell the WM server the IP address it should bind to, using the “watt.net.inetaddress=<ip_addr>” directive in the server.cnf.

So Atul, you could try this method - specify the IP in server.cnf, and simply inspect the “watt.net.inetaddress” property at runtime.

IS will ‘listen’ on the IP specified by “watt.net.inetaddress” – i.e. clients can connect to it at this IP. But the quirk is that when IS initiates a network connection (say, using pub.client:http). It initiates the connection using the DEFAULT network address – NOT the IP specified in server.cnf.

Any ideas about this?

Yes as the settings indicate binding a port to an ip address are for listeners (incoming requests). Therefore for outgoing connections these ports are irrelevant and therefore can’t be used to configure the ip address to bind to. It would be nice to at least be able to bind the outgoing connections to a specified ip address rather than the default address. All ip addresses within IS are for incoming requests unfortunately.

The outbound path for a socket request is determined by the routes defined on the host.

So if a machine has multiple IP addresses, it may also have a route to identify which one to use, to connect to a specific IP address.

Normally, these routing tables are kept dynamic and operate at Link Layer

Networking Gurus! please correct me if I am wrong.

Opps. Routing occurs at Network Layer. Bridging occurs at Link Layer. I have corrected myself.

Thanks guys.

Atul - a correction to what I said - the server IP directive is “watt.server.inetaddress”, not “watt.net.inetaddress”

My TCP/IP sockets knowledge is rusty, but I think a TCP/IP client can create a connection from a specific local IP address, right? It would be good for WM to default the client IP address to the value of “watt.server.inetaddress” and allow a new “watt.net.inetaddress” directive to override that.