|
|
|
Host Session Operation
The normal sequence of the initial operation of the Host:
- Setup the IO. (Usually networking.)
- Create a host session.
- Create Event, Session, and/or Callback processing objects and/or routines.
- Get references to the Incoming Message and the Outgoing Message.
- Set the CIGI version of the external interface.
- Set the external interface as synchronous or asynchronous.
- Get a reference to the Incoming Message object.
- Set the internally used version of CIGI.
- Set whether iteration is used or not used.
- Register all Event, Signal, and Callback processors being used.
- Create a CigiIGCtrlV? object and set the parameters as needed.
- 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 );
}
int sentBytes = network.send(
CigiOutgoingBufferPointer,
CigiOutgoingMsgSize );
}
OutgoingMsg.FreeMsg();
|
| |
|
|
|
|
|
|
|
|
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** |
|