Compaq Reliable Transaction Router Rtr C, Example of object creation in an RTR server program

Models: Reliable Transaction Router

1 78
Download 78 pages 48.87 Kb
Page 57
Image 57

 

Application Programming Interfaces

Sample C++

Example of object creation in an RTR server program.

server code

 

void CombinationOrderProcessor::StartProcessingOrdersAtoL()

{

//

//Create an RTRKeySegment for all ASCII values between "A" and "L."

m_pkeyRange = new RTRKeySegment (rtr_keyseg_string, //To process strings.

1,//Length of the key. OffsetIntoApplicationProtocol, //Offset value.

"A",

//Lowest ASCII value for partition.

"L");

//Highest ASCII value for partition.

StartProcessingOrders(PARTITION_NAMEAToL,m_pKeyRange);

}

//

//Create an RTRData Oobject to hold each incoming message or event. This

//object will be reused.

//

RTRData *pDataReceived= new RTRData();

//

//Continually loop, receiving messages and dispatching them to the handlers.

while(true)

{

sStatus = pTransaction->Receive(&pDataReceived); ASSERT(RTR_STS_OK == sStatus);

sStatus = pDataReceived->Dispatch(); ASSERT(RTR_STS_OK == sStatus);

}

RTR C

You can use the C programming interface to write C applications

Programming

that use RTR. For more information on the C programming

Interface

interface, see the RTR C Application Programmer's Reference

 

Manual and the RTR Application Design Guide.

 

Snippets from client and server programs using the RTR C-

 

programing API follow and are more fully shown in the RTR

 

Application Design Guide.

RTR Interfaces 4–9

Page 57
Image 57
Compaq Reliable Transaction Router Rtr C, Example of object creation in an RTR server program, Application Design Guide