10.6 Creating a New Agent

To create a new agent, one has to do the following:

  1. decide its inheritance structureSectionsec:pingexample, and create the appropriate class definitions,
  2. define the []recv and []timeout methodsSectionsec:agents:exmethods,
  3. define any necessary timer classes,
  4. define OTcl linkage functionsSectionsec:agents:exlinkage,
  5. write the necessary OTcl code to access the agentSectionsec:agents:exotclcode.

The action required to create and agent can be illustrated by means of a very simple example. Suppose we wish to construct an agent which performs the ICMP ECHO REQUEST/REPLY (or ``ping'') operations.


Tom Henderson 2011-11-05