10.6 Creating a New Agent
To create a new agent, one has to do the following:
- decide its inheritance structureSectionsec:pingexample,
and create the appropriate class definitions,
- define the recv and timeout methodsSectionsec:agents:exmethods,
- define any necessary timer classes,
- define OTcl linkage functionsSectionsec:agents:exlinkage,
- 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.