Real-time NMI: Interacting with the servers

In the case of the TCP connection information service (SYSTCPCN ) and the zERT information services (SYSTCPER and SYSTCPES), after connecting to the server over AF_UNIX socket, /var/sock/SYSTCPCN.tcpipprocname, or /var/sock/SYSTCPER.tcpipprocname, or /var/sock/SYSTCPES.tcpipprocname, respectively the application must then send a connection request record to the server over the connected socket (see the client request record in Real-time NMI: Requests sent by the client to the server). For the other services, the application does not need to take action.

After the client connects to the desired server (or, in the case of the SYSTCPCN, SYSTCPER, or SYSTCPES service, after sending a connection request record), the server sends an initial record to the client which identifies the server (see the tmi_init record in Records sent by the server to the client: Initialization record). After that record is received, the client is sent tmi_token records that represent data buffers. A record is sent for each data buffer that is filled in by TCP⁄IP. Records for partial buffers are sent if there has been no activity for a brief period. In case there is no activity, the client should be prepared to wait indefinitely for incoming tokens.

When the server needs to terminate the connection, it attempts to send a special termination record (see the tmi_term record in Records sent by the server to the client: Termination record) over the socket to the connected application, after which it closes the socket. This termination record describes the reason for closure. In some cases, the server might be unable to send such a record, and will close the socket. The application should be prepared to handle either case.

Particularly for the SYSTCPDA, SYSTCPOT, SYSTCPCN, SYSTCPER, and SYSTCPES interfaces, large amounts of data can be generated.
Restriction: Except in the case of sending a connection request record for the SYSTCPCN, SYSTCPER and SYSTCPES services, the client application must never send data to the server. If data is unexpectedly received by the server, the server sends a termination record with tmit_termcode = EPIPE to the client, and closes the connection.