![]() | ![]() |
Home |
|
|
Open Client Client-Library/C Reference Manual |
|
| Chapter 3 Routines |
|
| ct_poll |
|
| Parameters |
A pointer to a CS_CONTEXT structure.
Either context or connection must be NULL. If context is NULL, ct_poll checks only a single connection.
connectionA pointer to a CS_CONNECTION structure. A CS_CONNECTION structure contains information about a particular client/server connection.
Either context or connection must be NULL. If connection is NULL, ct_poll checks all open connections within the context.
millisecondsThe length of time, in milliseconds, to wait for pending operations to complete.
If milliseconds is 0, ct_poll returns immediately. To check for operation completions without blocking, pass milliseconds as 0.
If milliseconds is CS_NO_LIMIT, ct_poll does not return until any of the following is true:
A server response arrives. This can be a registered procedure notification or the data needed to complete a call to an asynchronous routine.
No asynchronous-routine completions are pending. If no completions are pending when ct_poll is called, then it returns CS_QUIET (see the Return value section for more information).
A system interrupt occurs.
ct_poll does not wait for the arrival of notification events. However, ct_poll does trigger the notification callback for notification events that are present when it is called or that arrive while ct_poll is waiting for asynchronous routine completions.
The address of a pointer variable. If connection is NULL, all connections are polled and ct_poll sets *compconn to point to the connection structure owning the first completed operation it finds.
If no operation has completed by the time ct_poll returns, ct_poll sets *compconn to NULL.
If connection is supplied, compconn must be NULL.
compcmdThe address of a pointer variable. ct_poll sets *compcmd to point to the command structure owning the first completed operation it finds. If no operation has completed by the time ct_poll returns, ct_poll sets *compcmd to NULL.
compidThe address of an integer variable. ct_poll sets *compid to one of the following symbolic values to indicate what has completed:
Value of compid | Meaning |
BLK_DONE | blk_done has completed. |
BLK_INIT | blk_init has completed. |
BLK_ROWXFER | blk_rowxfer has completed. |
BLK_SENDROW | blk_sendrow has completed. |
BLK_SENDTEXT | blk_sendtext has completed. |
BLK_TEXTXFER | blk_textxfer has completed |
CT_CANCEL | ct_cancel has completed. |
CT_CLOSE | ct_close has completed. |
CT_CONNECT | ct_connect has completed. |
CT_DS_LOOKUP | ct_ds_lookup has completed. |
CT_FETCH | ct_fetch has completed. |
CT_GET_DATA | ct_get_data has completed. |
CT_NOTIFICATION | A notification has been received. |
CT_OPTIONS | ct_options has completed. |
CT_RECVPASSTHRU | ct_recvpassthru has completed. |
CT_RESULTS | ct_results has completed. |
CT_SEND | ct_send has completed. |
CT_SEND_DATA | ct_send_data has completed. |
CT_SENDPASSTHRU | ct_sendpassthru has completed. |
A user-defined value. This value must be greater than or equal to CT_USER_FUNC. | A user-defined function has completed. |
A pointer to a variable of type CS_RETCODE. ct_poll sets *compstatus to indicate the final return code of the completed operation. This value corresponds to the value that would be returned by a synchronous call to the routine under the same conditions. This can be any of the return codes listed for the routine, with the exception of CS_PENDING.
|
|