Question & Answer
Question
A REXX exec application using TCP/IP Socket calls receives the error 2009 ESOCKETNOTDEFINED Socket not defined.
Cause
This error condition is a normal response whenever a socket call is issued that specifies a nonexistent socket number. It can also occur when using nested invocations of multiple execs using the ISPF SELECT service (not to be confused with the sockets SELECT call). If the application is using sockets created within one exec from another exec, the attempted usage fails with the above error as well.
Answer
Ensure that the correct socket number is being supplied to the sockets function.
If the problem is the use of nested execs running under ISPF, correct the application logic to use each exec's invocation of the Sockets API services as its own environment. Use the GIVESOCKET and TAKESOCKET calls if the sockets need to be passed from one exec to the other.
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21198584