Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

Reading from a Server-Side Queue

Data is read from the beginning of a server-side queue (system queue) by calling the function ctSysQueueRead(). The syntax is:

ctCONV NINT ctDECL ctSysQueueRead(NINT qhandle, pVOID buffer, NINT buflen,

LONG timeout)

Parameter qhandle is a system queue handle returned by a call to ctSysQueueOpen(). The timeout parameter specifies the time in milliseconds that ctSysQueueRead() will block waiting for data. Specifying ctWAITFOREVER for the timeout parameter causes ctSysQueueRead() to block until data is available in the queue. Parameter buffer is a pointer to a memory block large enough to hold the next message in the queue, and buflen indicates the size in bytes of buffer. ctSysQueueRead() returns NO_ERROR (0) on success. ctSysQueueRead() returns error NTIM_ERR (156, timeout) if the time specified by timeout parameter expires and no message is available.

For code examples on how to use ctSysQueueRead(), please see the examples provided in Creating or Opening a Server-Side Queue and Writing to a Server-Side Queue.