Define the start of an asynchronous conversation
For a list of protocols that support asynchronous communication, see 64-bit recording, Async, and IPv6 support.
After VuGen scans a Vuser script for asynchronous communication, the Async tab of the Design Studio lists the asynchronous conversations that VuGen found in the script. VuGen inserts a web_reg_async_attributes into the Vuser script at the start of each asynchronous conversation that was detected. Use VuGen's Step Navigator to find the associated web_reg_async_attributes steps in the Vuser script. The web_reg_async_attributes steps should be located where the asynchronous conversations start when the script runs.
A web_reg_async_attributes step that is added to a Vuser script includes the following parameters:
- ID
- URL
- Pattern
- PollIntervalMS (for poll-type conversations only)
- RequestCB
-
ResponseBodyBufferCB (for push-type conversations only)
- ResponseHeadersCB (for push-type conversations only)
- ResponseCB
The URL parameter in the web_reg_async_attributes step should be the same as one of the URLs that are specified in the step that follows the web_reg_async_attributes step. For details on the web_reg_async_attributes step, see the Function Reference (select the relevant version).
Inserting a Comment
When VuGen inserts a web_reg_async_attributes step into a script, VuGen inserts an associated comment before the web_reg_async_attributes step. The inserted comment contains information about the associated asynchronous conversation, such as the conversation ID, the communication pattern (push, poll, or long-poll), a list of URLs that are part of the asynchronous communication, and list of callbacks implemented in the AsyncCallbacks.c extra file.
Notice that the step comment contains a TODO token. The TODO token indicates that you should check the relevant callback implementations in the AsyncCallbacks.c extra file.
For details on how an asynchronous conversation is terminated, see Define the end of an asynchronous conversation.
Example - web_reg_async_attributes
The sample code below shows a web_reg_async_attributes step that was added by VuGen. Notice that the web_reg_async_attributes step was added before a web_url step, and that the URL parameter in the web_reg_async_attributes step is the same as the URL parameter in the web_url step.