Operating System - OpenVMS
1748201 Members
3053 Online
108759 Solutions
New Discussion юеВ

How to direct socket connections using JAVA and logical tcpip$inet_addr ?

 
Thomas Ritter
Respected Contributor

How to direct socket connections using JAVA and logical tcpip$inet_addr ?

We have communications between unix and vms using Java/RMI. Our VMS hosts have at least three Ethernet connections. The basic java implementation on VMS seems to use the logical tcpip$inet_hostaddr to request the caller where to send the returning packet. The obvious problem being that tcpip$inet_hostaddr can only have one value at any time and has system scope. The developers claim they have no control over how java uses this logical. Ideally we would like to direct java to use any of the three possible interfaces. I have asked for samples of code to show how the socket connections are currently working.
There must be something in java to control socket connections. What do the experts think ?

VMS 7.3-2 ucx 5.4 eco5,
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition
Classic VM (build 1.3.1-7, 12/15/2003-21:59, native threads, jit)
2 REPLIES 2
Jonathan Cronin
Advisor

Re: How to direct socket connections using JAVA and logical tcpip$inet_addr ?

"The basic java implementation on VMS seems to use the logical tcpip$inet_hostaddr to request the caller where to send the returning packet."

I'm not sure what this means: who's the caller in this
situation? An incoming connection?

I can see two cases here:

a) You are listening for connections and want to control
which local IP address (Ethernet connection) to listen on.

The Java ServerSocket class constructors let you specify the local IP address.

http://java.sun.com/j2se/1.4.2/docs/api/java/net/ServerSocket.html#ServerSocket(int,%20int,%20java.net.InetAddress)

b) You are connecting out and want to go out via a particular local IP address.

The Java Socket class constructors let you specify the local
IP address.

http://java.sun.com/j2se/1.4.2/docs/api/java/net/Socket.html#Socket(java.net.InetAddress,%20int,%20boolean)

If Java is using the TCPIP$INET logical in some way you cannot control in Java, you can redefine it in a job or process or group table to override the system logical.
Thomas Ritter
Respected Contributor

Re: How to direct socket connections using JAVA and logical tcpip$inet_addr ?

The communicate is between UNIX and VMS
UNIX sends initial request to VMS on port 8081.
VMS responds to UNIX and in response packet the return address is provided.
UNIX sends next response to VMS on address provided. Firewall drops packet.
VMS has 3 interfaces. Only 1 network will provide the connectivity.

It seems that the only way to control the address of the response packet is by the value stored in tcpip$inet_addr.

Defining tcpip$inet_addr in the process table has no affect.
I have also logged as a fault with HP.