CCL Version 3.3.1 
CIGI Class Library : Users' Guide
Operation : Host Session

Host Session Operation

The normal sequence of the initial operation of the Host:
  1. Setup the IO. (Usually networking.)
  2. Create a host session.
  3. Create Event, Session, and/or Callback processing objects and/or routines.
  4. Get references to the Incoming Message and the Outgoing Message.
  5. Set the CIGI version of the external interface.
  6. Set the external interface as synchronous or asynchronous.
  7. Get a reference to the Incoming Message object.
  8. Set the internally used version of CIGI.
  9. Set whether iteration is used or not used.
  10. Register all Event, Signal, and Callback processors being used.
  11. Create a CigiIGCtrlV? object and set the parameters as needed.
  12. Call the Outgoing message object "BeginMsg()" method to initialize the message.

The normal per frame sequence of the operation of the Host:

1.   Process the current message from the IG if any:

if( CigiIncomingMsgSz > 0 ) { try { IncomingMsgPointer->ProcessIncomingMsg( (unsigned char *)CIncomingMsgBuffer, CigiIncomingMsgSize ); } catch ( CigiException &theException ) { std::cout << "getNetMessages - Exception: " << theException.what() << std::endl; } }

2.  Modify the IG Control object as needed.
3.  Pack the IG Control packet onto the outgoing message buffer as shown:

OutgoingMessage << IG_Control_object

4.  Create, Modify, and pack other packets as necessary.
5.  Package the message:

try { OutgoingMsg.PackageMsg( & CigiOutgoingBufferPointer, CigiOutgoingMsgSize ); } catch ( CigiException & theException ) { std::cout << "getNetMessages - Exception: " << theException.what() << std::endl; }

6.  Wait and receive the IG's SOF message

CigiInSz = 0; while(CigiInSz == 0) { CigiInSz = network.recv( CInBuf, RECV_BUFFER_SIZE ); }

7.  Update the IG Control (specifically the frame counter and possibly the Database ID) packet in the outgoing message buffer..
8.  Send the outgoing message:

if( pCigiOutBuf != NULL) { if( CigiIncomingMsgSize > 0) { OutgoingMsg.UpdateIGCtrl( CigiOutgoingBufferPointer, CIncomingMsgBuffer ); } else { OutgoingMsg.UpdateIGCtrl( CigiOutgoingBufferPointer, NULL ); } // send CIGI message int sentBytes = network.send( CigiOutgoingBufferPointer, CigiOutgoingMsgSize ); } // Frees the buffer containing the message that was just sent OutgoingMsg.FreeMsg();
SourceForge LogoBoeing
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********