Previous PageTable Of ContentsHomeIndexNext Page


5.5. Asynchronous with Win32 Synchronization Model

The Asynchronous with Win32 Synchronization model allows an asynchronous application to receive SRL event notification through standard Win32 synchronization mechanisms. The two mechanisms supported are Reset Events and I/O Completion Ports. In this model, the application informs the SRL to signal the specified Reset Event or I/O Completion Point when an event occurs on a Dialogic device. When the application receives notification, it calls standard Dialogic event retrieval functions to process the event.

Choose the Asynchronous with Win32 Synchronization model for an application that needs the tightest possible integration with other Win32 devices.

For reset events, an application should perform the following operations.

When the application initializes:

  1. Use the Win32 CreateEvent( ) function to create the event.
  2. Fill in the SRLWIN32INFO structure to indicate that reset events are being used. The dwHandleType field must be set to SR_RESETEVENT. The ObjectHandle field must be set to the event handle returned by the CreateEvent( ) function.
  3. Call the sr_setparm( ) function with the parameter number argument set to SR_WIN32INFO.

To wait for event notification:

  1. Call the Win32 WaitForSingleObject( ) or WaitForMultipleObjects( ) function. The WaitForMultipleObjects( ) function is most commonly used because the application can wait for event notification from multiple sources.
  2. At notification, if the event source is a Dialogic device, call the sr_waitevt( ) function, with a zero timeout, to retrieve the event from the Dialogic event queue. To identify the Dialogic device and event, use the sr_getevtdev( ) and sr_getevttype( ) functions.

For I/O Completion Ports, an application should perform the following operations:

When the application initializes:

  1. Use the Win32 CreateIoCompletionPort( ) function to create the Completion Port.
  2. Fill in the SRLWIN32INFO structure to indicate that I/O Completion Points are being used. The dwHandleType field must be set to SR_IOCOMPLETIONPORT. The ObjectHandle field contains the Completion Port handle returned by the CreateIoCompletionPort( ) function. The dwUserKey field must be set to the user-specified key that is returned at the time of event notification. The lpOverlapped field may be set to an optional user-specified OVERLAPPED structure.
  3. Call the sr_setparm( ) function with the parameter number argument set to SR_WIN32INFO.

To wait for event notification:

  1. Call the Win32 GetQueuedCompletionStatus( ) to wait for events from multiple sources, including SRL devices.
  2. At notification, if the event source is a Dialogic device, call the sr_waitevt( ) function, with a zero timeout, to retrieve the event from the Dialogic event queue. To identify the Dialogic device and event, use the sr_getevtdev( ) and sr_getevttype( ) functions.

An example of the Asynchronous with Win32 Synchronization model is shown below:


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