HP OpenVMS Systems

ask the wizard
Content starts here

TCP/IP sockets, bind, and SS$_DUPLNAM?

» close window

The Question is:

I am looking into client/server programming using sockets. I have taken the
 first programming example which ships with UCX and adapted this so that the
 both the server and the client explicitly bind to a local IP address and to a
 specific port number. Thi
s works reliably with the server which can be restarted immediately without
 problems. However when the client is bound to a port a restart within about 1
 minute of the client fails at the connection (ACCESS) call with the error
%SYSTEM-F-DUPLNAM, duplicate name.
If one waits a little while the client starts correctly.
I have searched the documentation and tries many of the socket creation options
 (e.g. linger time etc) but none of these cure the problem. Can you explain
 what is causing the client problem, why it only affects the client and what
 (if anything) ) can do t
o sure this problem.
Note that if I do not specify and explicit port for the client (i.e. set port
 to 0) then I have no restart problems as the system appaers to cycle through
 the available ports.

The Answer is :

  If the port is in the state TIME_WAIT (usually not visible with SHOW
  DEVICE BG, only via the "netstat -a" option), then the port is
  inaccessable until the timer expires or until REUSEADDR or REUSEPORT
  is specified before binding to the local port.
  If you wish to pursue this, you will want to contact the support center
  directly, as configuration and code details will be required.
  You will also want to move to TCP/IP Services V5.1, V5.3 or (as available)
  a later release, with the associated current ECO kit installed.  (The
  updated releases can also have updated example programs.  For other
  coding examples, please see the "AskQ" area referenced in the FAQ.)

answer written or last revised on ( 5-AUG-2002 )

» close window