跳到主要内容

5. Check(检查)

该操作使指定本地套接字的状态被返回。该操作没有与之相关联的完成码变量, 因为它总是成功, 且套接字由其套接字编号标识。该操作在任何时刻都有效, 并且总是立即完成。

调用序列如下:

CALL CHECK (lclsck, stat, menu, fgnsck, deficit)

其中

'lclsck' 是本地套接字的套接字标识符。

'stat' 是状态的代码, 类型为 INTEGER*4。

'mnem' 是状态的助记符, 可为任意类型, 长度大于或等于 8 字节。

'fgnsck' 是远端套接字的套接字标识符, 或为零。

'deficit' 是以位为单位的发送/接收差额, 或为零; 其类型为 INTEGER*4。

'lclsck' 是程序员唯一需要定义的实参; 其余都是子程序的输出。

   'STAT'    'MNEM'         MEANING
   ------    ------         ---------
     0        OPEN         A connection is fully established. No
                           SEND/RECEIVE operation is in progress.
                          'fgnsck' is the socket identifier of the
                           connected socket.  'deficit' is the number of
                           bites queued locally at the socket by the NCP
                           and available to satisfy a future RECEIVE
                           operation, or awaiting output ads the results
                           of a previous SEND operation.

     1       LISTEN        A LISTEN has been issued.

     2       CONNECT       A CONNECT has been issued. 'fgnsck' is the
                           socket identifier of the foreign socket.

     3       DECISION      A LISTEN has been completed.  'fgnsck' is
                           the socket identifier of the calling socket.

     4       CALL(S)       One or more calls have been received for the
                           local socket. No LISTEN or CONNECT has been
                           issued.

     5       I/O           A connection is fully established. A
                           SEND/RECEIVE operation is in progress.
                          'fgnsck' is the socket identifier of the
                           connected socket.  'deficit' is the number
                           of bits yet to be sent or received.

     6       CLOSED        The socket is in the closed state.

     7      <--DRAIN       The foreign socket is attempting to close the
                           connection.  The NCP has data yet to be ready
                           by the local socket.  'fgnsck' is the socket
                           identifier of the connected socket.
                          'deficit' is the number of bits yet to be
                           received.

     8       DRAINED       The foreign socket is attempting to close the
                           connection.  The NCP is awaiting arrival at
                           the foreign site of data currently in
                           transit.  'fgnsck' is the socket identifier
                           of the connected socket.

     9       CLOSING       The local socket has issued a CLOSE. The NCP
                           is in the process of returning the local
                           socket to the closed state. 'fgnsck' is the
                           socket identifier of the connected socket.

    10       DRAIN-->      The local socket has issued a CLOSE.  The NCP
                           is completing the last SEND operation before
                           returning the local socket to the closed
                           state.  'fgnsck' is the socket identifier
                           of the connected socket. 'deficit' is the
                           number of bits the NCP has yet to transmit.