Previous Topic: TCP/IP Programming Support for Online ApplicationsNext Topic: Notes


Socket Macro Interface for Assembler Programs

Programs written in the Assembler language use the #SOCKET macro to exploit TCP/IP sockets. The #SOCKET macro takes the following general form:

label    #SOCKET function,                                      X
               RETCODE=return-code,                             X
               ERRNO=errno,                                     X
               RSNCODE=reason-code,                             X
               PLIST=parameter-list-area,                       X
               RGSV=(rgsv),                                     X
               CALL=call-value,                                 X
               function-specific-parameters

Parameter

Description

label

Specifies the optional Assembler label.

function

Specifies the name of the function to execute. A detailed description of the supported functions can be found in Function Descriptions.

return-code

Specifies the name of a fullword that receives the outcome of the operation. The following are the possible values:

  • 0—No error occurred.
  • -1—A socket error was encountered; the errno and reason-code fields contain more detailed information about the error.

errno

Specifies the name of a fullword that receives the ERRNO value when return-code is -1. For more information, see Return, Errno, and Reason Codes.

reason-code

Specifies the name of a fullword that receives the reason code value when return-code is -1. For more information, see Return, Errno, and Reason Codes.

parameter-list-area

Specifies the name of an area or register pointing to the area that is used to build the #SOCKET parameter list. The default is SYSPLIST. The length of the parameter-list-area used by the macro depends on the #SOCKET function that is called; the longest parameter-list currently needed for a #SOCKET call is 16 fullwords.

rgsv

Specifies the registers to be saved. This parameter applies only to system mode programs. The default is (R2-R8).

call-value

Indicates whether to generate the parameter list and/or execute the function. The following are the possible values:

  • YES—Generates the parameter list and executes the function. This is the default.
  • NO—Generates the parameter list, but does not execute the function.
  • ONLY—Executes the function for which a parameter list is pre-built.