📄 node113.html
字号:
<html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><!--Converted with jLaTeX2HTML 2002 (1.62) JA patch-1.4patched version by: Kenshi Muto, Debian Project.LaTeX2HTML 2002 (1.62),original version by: Nikos Drakos, CBLU, University of Leeds* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan* with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --><HTML><HEAD><TITLE>10.6 Creating a New Agent</TITLE><META NAME="description" CONTENT="10.6 Creating a New Agent"><META NAME="keywords" CONTENT="everything"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META NAME="Generator" CONTENT="jLaTeX2HTML v2002 JA patch-1.4"><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"><LINK REL="STYLESHEET" HREF="everything.css" tppabs="http://www.isi.edu/nsnam/ns/doc/everything.css"><LINK REL="next" HREF="node118.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node118.html"><LINK REL="previous" HREF="node107.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node107.html"><LINK REL="up" HREF="node99.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node99.html"><LINK REL="next" HREF="node114.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node114.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html3038" HREF="node114.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node114.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html3032" HREF="node99.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node99.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html3026" HREF="node112.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node112.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html3034" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html3036" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html3039" HREF="node114.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node114.html">10.6.1 Example: A ``ping''</A><B> Up:</B> <A NAME="tex2html3033" HREF="node99.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node99.html">10. Agents</A><B> Previous:</B> <A NAME="tex2html3027" HREF="node112.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node112.html">10.5.5 Implementing Timers</A>   <B> <A NAME="tex2html3035" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html3037" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H1><A NAME="SECTION03760000000000000000"></A><A NAME="sec:createagent"></A><BR>10.6 Creating a New Agent</H1><P>To create a new agent, one has to do the following:<OL><LI>decide its inheritance structureSectionsec:pingexample, and create the appropriate class definitions,</LI><LI>define the []recv and []timeout methodsSectionsec:agents:exmethods,</LI><LI>define any necessary timer classes,</LI><LI>define OTcl linkage functionsSectionsec:agents:exlinkage,</LI><LI>write the necessary OTcl code to access the agentSectionsec:agents:exotclcode.</LI></OL><P>The action required to create and agent can be illustratedby means of a very simple example.Suppose we wish to construct an agent which performsthe ICMP ECHO REQUEST/REPLY (or ``ping'') operations.<P><BR><HR><!--Table of Child-Links--><A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A><UL><LI><A NAME="tex2html3040" HREF="node114.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node114.html">10.6.1 Example: A ``ping'' requestor (Inheritance Structure)</A><LI><A NAME="tex2html3041" HREF="node115.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node115.html">10.6.2 The <TT>recv</TT>() and <TT>timeout</TT>() Methods</A><LI><A NAME="tex2html3042" HREF="node116.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node116.html">10.6.3 Linking the ``ping'' Agent with OTcl</A><LI><A NAME="tex2html3043" HREF="node117.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node117.html">10.6.4 Using the agent through OTcl</A></UL><!--End of Table of Child-Links--><BR><HR><ADDRESS>2003-09-23</ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -