Previous Topic: SINENext Topic: SQUARE-ROOT


SOCKET

Purpose

Interface from CA ADS to TCP/IP.

Syntax

►►──── SOCKET ─ ( function, return-code, errno, reason-code ─────────────────►

 ►────┬───────────────────────────────────────────────┬─────────────── ) ────►◄
      │      ┌─────────────── , ───────────────┐      │
      └─ , ──▼── function-dependent-parameter ─┴──────┘

Parameters

The parameters are the standard parameters used for CA IDMS interface to TCP/IP as documented in CA IDMS Callable Services Guide.

The first four parameters passed are always the same:

  1. function: a 4-byte binary field, S9(5) USAGE IS COMP, in which the desired socket function must be filled in by the programmer.
  2. return-code: a 4-byte binary field which receives the outcome of the operation. Returned values are:
  3. errno: a 4-byte field which receives the ERRNO value when the return code is -1.
  4. reason code: a 4-byte binary field which receives the reason code value when the return-code is -1.

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

Note: If an optional parameter is not to be specified in the parameter list, it should be replaced by the @ character. A pre-defined record in the dictionary, SOCKET-CALL-INT, describes the socket function's return codes and the errno's, and should be included as a work record.

An ADS dialog associated with a server task (a task started by a listener):

The build-in function should be used within an IF statement. For example:

IF (SOCKET(function,
           return-code,
           errno,
           reason-code,
           function-dependent-parameter1,
           ...)) NE ZERO