[AGENT++] When does Agent++ check if oid is valid ?

Dirk Merettig Dirk.Merettig at urz.uni-heidelberg.de
Fri Nov 28 10:08:52 CET 2003


Hi all,
I have a question about when Agent++ checks if the OID it receives in a
get-request is checked for validity.
My problem is that I have tables that change size while the Agent runs
depending on for example how many rings exist in my program.
Now I want to have a central point where I can adjust the tables to the
right sizes.

  while (!Terminated) // loop until terminated
  {
    // wait for incoming request max 50 sec
    // and then just loop once
    req = Owner->reqList->receive(50);
    if (req)
    {
      AddProtLine("Request received");
      Synchronize(ProcessRequest);
    }
  }
}
//---------------------------------------------------------------------------
void __fastcall TSNMPListen::ProcessRequest(void)
{
  int ringCount = MainFrWin->RingWinList->Count;
  int ringTableCount = hytec_nwm_mib_hytecNWMRingEntry::instance->size();
  if (ringCount > ringTableCount)
hytec_nwm_mib_hytecNWMRingEntry::instance->table_up();
  if (ringCount < ringTableCount)
hytec_nwm_mib_hytecNWMRingEntry::instance->table_down();
  Owner->mib->process_request(req); // process the request
}

So now, I adjust the tables ( only RingCount in the example) between
reqList->receive and mib->process_request. So far it seems to work. Does
Agent++ check for the validity of the OID in reqList->receive or in
process_request ? I guess its process_request ?
Can I nevertheless expect inconsistencies with this code ?
Are there better solutions ?

Thanks a lot for help !

Dirk





More information about the AGENTPP mailing list