Socket API traces

The SOCKAPI option, for the TCP/IP CTRACE component SYSTCPIP, is intended to be used for application programmers to debug problems in their applications. The SOCKAPI option captures trace information related to the socket API calls that an application might issue. The SOCKET option is primarily intended for use by TCP/IP Service and provides information meant to be used to debug problems in the TCP/IP socket layer, UNIX System Services, or the TCP/IP stack.

CTRACE is available only to users with console operator access. If the application programmer does not have console access, someone must provide the CTRACE data to the programmer. For security reasons, it is suggested that only the trace data related to the particular application be provided. The following sections explain how to obtain the trace data for a particular application, format it, and save the formatted output. The application data can be isolated when recording the trace, or when formatting it, or both.

z/OS® provides several socket APIs that applications can use. The figure in the example shows different APIs along with the high level flows of how they interact with the TCP/IP stack.

The SOCKAPI trace output is captured in the Sockets Extended Assembler Macro API (the Macro API). Given the structure of the TCP/IP APIs, this trace also covers the Call Instruction API, the CICS® Socket API, and the IMS™ socket API. Some of the socket APIs based on the Macro API currently encapsulate some of the Macro API processing.

For example, in a CICS TS environment, CICS sockets-enabled transactions do not have to issue an SOCKAPI call. Rather, this is done automatically for the socket API by the TCP/IP CICS TRUE (Task Related User Exit) component layer. If the socket API trace is active, trace records for the SOCKAPI calls are created.

Figure 1. TCP/IP networking API relationship on z/OS
Diagram that shows how the APIs interact with the TCP/IP stack on z/OS. The CICS sockets and IMS sockets are on top of the sockets extended call API. The sockets extended call API is on top of the sockets extended assembler macro API. These APIs, together with the REXX sockets, the z/OS CS TCP/IP C/C++ sockets, the Language Environment (UNIX) C/C++ sockets, and the Pascal API, can be called by application programs and subsystems.