DTMavailRead(3DTM)

NAME
DTMavailRead, DTMavailWrite - Determine if a port is available for receiving/writing messages.

SYNOPSIS
#include <dtm.h>

int DTMavailRead(int portid)

int DTMavailWrite(int portid)

DESCRIPTION
DTMavailRead performs a non-blocking check for a message on the input port specified by portid. DTMavailRead returns a non-zero value if a message is available and zero otherwise.

DTMavailWrite sends a "ready to send" message to the port specified by portid. DTMavailWrite will then check for the receipt of a "clear to send" message from every reader attached to that port. If all readers return the "clear to send" message, DTMavailWrite returns a non-zero value to the process that called it, guaranteeing that each reader is waiting to receive data.

SEE ALSO
DTM, DTMbeginRead

DIAGNOSTICS
These functions will return DTMERROR if a problem is encountered. Since DTMERROR also represents a true value, an application can check for the possibility of an error by examining DTMerrno for a non-zero state after the call. DTMerrno can contain one of these possible values:

    DTMPORTINIT    invalid value for portid.
    DTMSOCK    problem creating connection.