(UNIX only) Determine whether the DB-Library network buffer contains any unread bytes.
DBBOOL DBRBUF(dbproc) DBPROCESS *dbproc;
A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and server.
“TRUE” (bytes remain in buffer) or “FALSE” (no bytes in buffer).
Note that DBRBUF actually returns “TRUE” both when there are bytes available in the read buffer, and when no more results are available to be processed.
This is because the purpose of DBRBUF is to tell an application when it can read and be assured that it will not hang. If DBRBUF did not return “TRUE” in the case of no more results, then applications that loop while DBRBUF returns “FALSE” could loop indefinitely, if all results had already been processed.
This routine lets the application know if the DB-Library network buffer contains any bytes yet unread.
DBRBUF is ordinarily used in conjunction with dbsqlok and DBIORDESC.
dbpoll, a DB-Library/C routine which checks if a server response has arrived for any DBPROCESS, may replace DBRBUF. Since the UNIX-specific routines DBRBUF and DBIORDESC are non-portable, their use should be avoided whenever possible. They do, however, provide a way for application programs to integrate handling of DB-Library/C sockets with other sockets being used by an application.
An application uses these routines to manage multiple input data streams. To manage these streams efficiently, an application that uses dbsqlok should check whether any bytes remain either in the network buffer or in the network itself before calling dbresults.
To test whether bytes remain in the network buffer, the application can call DBRBUF. To test whether bytes remain in the network itself, the application can either call the UNIX select and DBIORDESC, or call dbpoll.