📄 node476.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>35.2.3 Using transport agents via system calls</TITLE><META NAME="description" CONTENT="35.2.3 Using transport agents via system calls"><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="node477.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node477.html"><LINK REL="previous" HREF="node475.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node475.html"><LINK REL="up" HREF="node473.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node473.html"><LINK REL="next" HREF="node477.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node477.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html8736" HREF="node477.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node477.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html8730" HREF="node473.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node473.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html8724" HREF="node475.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node475.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html8732" 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="tex2html8734" 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="tex2html8737" HREF="node477.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node477.html">35.2.4 Agent upcalls to</A><B> Up:</B> <A NAME="tex2html8731" HREF="node473.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node473.html">35.2 The transport agent</A><B> Previous:</B> <A NAME="tex2html8725" HREF="node475.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node475.html">35.2.2 Attaching applications to</A>   <B> <A NAME="tex2html8733" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html8735" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H2><A NAME="SECTION07123000000000000000"></A><A NAME="sec:systemcalls"></A><BR>35.2.3 Using transport agents via system calls</H2>Once transport agents have been configured and applications attached, applications can use transport services via the following system calls. These calls can be invoked at eitherOTcl or C++ level, thereby allowing applications to be coded in either C++ orOTcl. These functions have been implemented as virtual functions in the base<TT>class Agent</TT>, and can be redefined as needed by derived Agents. <UL><LI><TT>send(int nbytes)</TT>--Send nbytes of data to peer. For TCP agents,if <TT>nbytes == -1</TT>, this corresponds to an ``infinite'' send; i.e., theTCP agent will act as if its send buffer is continually replenished by theapplication.</LI><LI><TT>sendmsg(int nbytes, const char* flags = 0)</TT>--Identical to <TT>send(int nbytes)</TT>, except that it passes an additional string <TT>flags</TT>. Currently one flag value, ``MSG_EOF,'' is defined; MSG_EOFspecifies that this is the last batch of data that the application will submit, and serves as an implied close (so that TCP can send FIN with data).</LI><LI><TT>close()</TT>--Requests the agent to close the connection (only applicable for TCP).</LI><LI><TT>listen()</TT>--Requests the agent to listen for new connections(only applicable for Full TCP).</LI><LI><TT>set_pkttype(int pkttype)</TT>--This function sets the <TT>type_</TT> variable in the agent to <TT>pkttype</TT>. Packet types are defined in <TT>packet.h</TT>. This function is used to override the transport layer packet type for tracing purposes. </LI></UL>Note that certain calls are not applicable for certain agents; e.g., a callto []close a UDP connection results in a no-op. Additional callscan be implemented in specialized agents, provided that they are made<TT>public</TT> member functions. <P><HR><!--Navigation Panel--><A NAME="tex2html8736" HREF="node477.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node477.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html8730" HREF="node473.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node473.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html8724" HREF="node475.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node475.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html8732" 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="tex2html8734" 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="tex2html8737" HREF="node477.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node477.html">35.2.4 Agent upcalls to</A><B> Up:</B> <A NAME="tex2html8731" HREF="node473.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node473.html">35.2 The transport agent</A><B> Previous:</B> <A NAME="tex2html8725" HREF="node475.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node475.html">35.2.2 Attaching applications to</A>   <B> <A NAME="tex2html8733" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html8735" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <!--End of Navigation Panel--><ADDRESS>2003-09-23</ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -