HP LoadRunner Protocol SDK
Implement the main function

The main function includes registration of the protocol, registration of event handlers, and the C language function interfaces.

See The CProtocolExtension Class

Registration

When LoadRunner loads a protocol, the first action is to call the protocol's RegisterProtocol function, implemented in main.cpp. RegisterProtocol is called only once. In the RegisterProtocol function, the CProtocolExtension object is created and CProtocolExtension::Register is called.

In RegisterProtocol, register event handlers and perform any one-time setup actions required by your protocol. LoadRunner generally runs several processes for a protocol, each with a certain number of Vusers. Do not perform initializations in RegisterProtocol that are required independently by each process. Initializations required at a lower scope are performed by the event handlers. For example, implement initializations for each process (such as global variable values) in the PROCESS_INIT_EVENT handler and implement initializations for a new Vuser and for any thread required by your implementation in the THREAD_INIT_EVENT.

The return value of RegisterProtocol is the pointer to the protocol configuration returned by CProtocolExtension::Register.

Registration in main.cpp

Events that can be trapped

Timers and Vuser data in main.cpp

C Language Interface Definitions

See Code the API Functions

 Virtual User Data

See Virtual User Data

See Also