Previous Topic: COBOL Structure DescriptionNext Topic: Notes


Socket Call Interface for PL/I

Programs written in PL/I use the CALL statement to exploit TCP/IP sockets:

CALL IDMSOCKI
       (function,
       return_code,
       errno,
       reason_code,
       function_dependent_parameter1,
       ...);

A call to IDMSOCKI must pass the following first four parameters:

Parameter

Description

function

Specifies a 4-byte, fullword-aligned, integer field that the program sets to the desired socket function. The following is the sample definition of a function field:

DCL SOCKET_FUNCTION FIXED BINARY(31);

A detailed description of the supported functions can be found in Function Descriptions.

return_code

Specifies a 4-byte, fullword-aligned, integer field that receives the outcome of the operation. The following are the returned values:

  • 0—No errors occurred.
  • 20—A parameter list error was encountered.
  • -1—A socket error was encountered; the errno and reason_code fields contain more detailed information about the error.

The following is the sample definition of a return_code field:

DCL SOCKET_RETCD FIXED BINARY(31);

errno

Specifies a 4-byte, fullword-aligned, integer field that receives the ERRNO value when return_code is -1. The following is the sample definition of an errno field:

DCL SOCKET_ERRNO FIXED BINARY(31);

For more information, see Return, Errno, and Reason Codes.

reason_code

Specifies a 4-byte, fullword-aligned, integer field that receives the reason code value when return_code is -1. The following is the sample definition of a reason_code field:

DCL SOCKET_RSNCD FIXED BINARY(31);

For more information, see Return, Errno, and Reason Codes.

Depending on the function, zero or more parameters can follow.