Previous PageTable Of ContentsHomeIndexNext Page

sr_waitevt( )

Description | Cautions | Example | Errors

Name:

long sr_waitevt(timeout)

Inputs:

long timeout

  timeout in milliseconds (msec)

Returns:

time left before timeout

 

-1 if timeout

Includes:

srllib.h

Type:

Event Control function

Top Of PageDescription

The function sr_waitevt( ), for a specified period of time, waits for any event to occur on any Dialogic device

Parameter

Description

timeout

A timeout value of -1 instructs sr_waitevt( ) to wait indefinitely for the next event.

Use timeout 0 when the SRL event must return imediately, regardlesss of whether or not an event is present in the SRL event queue.

The sr_waitevt( ) function returns a value when the next event occurs, or when a timeout is reached. If an event occurs, the value returned is the number of milliseconds before the timeout. If no event occurs before the timeout, the value returned is -1. If the function times out, a timeout event occurs on the SRL_DEVICE. The sr_getevtdev(0) function returns SRL_DEVICE, the Dialogic device handle associated with the current event. The sr_getevttype(0) function returns SR_TMOUTEVT, which is the current event type.

Top Of PageCautions

When an application receives an event, the event must be handled immediately and event-specific information should be retrieved before the next call to sr_waitevt( ) because sr_waitevt( ) automatically removes the current event before waiting for the next event; previous information is overwritten.

The sr_waitevt( ) function cannot be called from within a handler.

You cannot use sr_waitevt( ) and sr_waitevtEx( ) functions in the same thread.

If you use the sr_waitevt( ) function to retrieve events, pass 0 as a parameter when using the following functions:

Top Of PageExample

Top Of PageErrors

If this function returns -1 to indicate failure, obtain the reason for the error by calling the SRL standard attribute function ATDV_LASTERR(SRL_DEVICE) or ATDV_ERRMSGP(SRL_DEVICE) to retrieve either the error code or a pointer to the error description, respectively. One of the following errors may be returned:

ESR_SYS

  Error from operating system; use dx_fileerrno( ) to obtain error value.


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

Copyright 2001, Dialogic Corporation
All rights reserved
This page generated January, 2001