⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 a00158.html

📁 uip-1.0,give everyone who want.
💻 HTML
📖 第 1 页 / 共 3 页
字号:
    <td><p>The length of the data that was previously read. <p>This macro returns the length of the data that was previously read using <a class="el" href="a00158.html#gb5d9c0becf7cb32d0aaef466839dd92e">PSOCK_READTO()</a> or PSOCK_READ().<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>psock</em>&nbsp;</td><td>(struct psock *) A pointer to the protosocket holding the data. </td></tr>  </table></dl><p>Definition at line <a class="el" href="a00193.html#l00281">281</a> of file <a class="el" href="a00193.html">psock.h</a>.    </td>  </tr></table><a class="anchor" name="g4a264bb64ae706d53f572b1d9e4037a2"></a><!-- doxytag: member="psock.h::PSOCK_END" ref="g4a264bb64ae706d53f572b1d9e4037a2" args="(psock)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">#define PSOCK_END          </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="a00082.html">psock</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Declare the end of a protosocket's protothread. <p>This macro is used for declaring that the protosocket's protothread ends. It must always be used together with a matching <a class="el" href="a00158.html#g84901a5aa60040e96d272a69977edd22">PSOCK_BEGIN()</a> macro.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>psock</em>&nbsp;</td><td>(struct psock *) A pointer to the protosocket. </td></tr>  </table></dl><dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="a00036.html#a116">hello-world.c</a>, and <a class="el" href="a00038.html#a182">smtp.c</a>.</dl><p>Definition at line <a class="el" href="a00193.html#l00325">325</a> of file <a class="el" href="a00193.html">psock.h</a>.    </td>  </tr></table><a class="anchor" name="gfa11b2a1faf395ae2a6626e01c482d5d"></a><!-- doxytag: member="psock.h::PSOCK_EXIT" ref="gfa11b2a1faf395ae2a6626e01c482d5d" args="(psock)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">#define PSOCK_EXIT          </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="a00082.html">psock</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Exit the protosocket's protothread. <p>This macro terminates the protothread of the protosocket and should almost always be used in conjunction with <a class="el" href="a00158.html#g5d56800f82bfc7bbf53bb4a659589812">PSOCK_CLOSE()</a>.<p><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00158.html#gc7cc1dba1819f7fcdaa9ff9eed5a08f4">PSOCK_CLOSE_EXIT()</a></dd></dl><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>psock</em>&nbsp;</td><td>(struct psock *) A pointer to the protosocket. </td></tr>  </table></dl><dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="a00038.html#a171">smtp.c</a>.</dl><p>Definition at line <a class="el" href="a00193.html#l00297">297</a> of file <a class="el" href="a00193.html">psock.h</a>.    </td>  </tr></table><a class="anchor" name="g10d9a9201cba1a6db623284c475c6cea"></a><!-- doxytag: member="psock.h::PSOCK_GENERATOR_SEND" ref="g10d9a9201cba1a6db623284c475c6cea" args="(psock, generator, arg)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">#define PSOCK_GENERATOR_SEND          </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="a00082.html">psock</a>,         <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>generator,         <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>arg&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Generate data with a function and send it. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>psock</em>&nbsp;</td><td>Pointer to the protosocket. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>generator</em>&nbsp;</td><td>Pointer to the generator function </td></tr>    <tr><td valign="top"></td><td valign="top"><em>arg</em>&nbsp;</td><td>Argument to the generator function</td></tr>  </table></dl>This function generates data and sends it over the protosocket. This can be used to dynamically generate data for a transmission, instead of generating the data in a buffer beforehand. This function reduces the need for buffer memory. The generator function is implemented by the application, and a pointer to the function is given as an argument with the call to <a class="el" href="a00158.html#g10d9a9201cba1a6db623284c475c6cea">PSOCK_GENERATOR_SEND()</a>.<p>The generator function should place the generated data directly in the uip_appdata buffer, and return the length of the generated data. The generator function is called by the protosocket layer when the data first is sent, and once for every retransmission that is needed. <p>Definition at line <a class="el" href="a00193.html#l00219">219</a> of file <a class="el" href="a00193.html">psock.h</a>.    </td>  </tr></table><a class="anchor" name="g26ae707402e494f3895a9f012a93ea29"></a><!-- doxytag: member="psock.h::PSOCK_INIT" ref="g26ae707402e494f3895a9f012a93ea29" args="(psock, buffer, buffersize)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">#define PSOCK_INIT          </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="a00082.html">psock</a>,         <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>buffer,         <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>buffersize&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Initialize a protosocket. <p>This macro initializes a protosocket and must be called before the protosocket is used. The initialization also specifies the input buffer for the protosocket.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>psock</em>&nbsp;</td><td>(struct psock *) A pointer to the protosocket to be initialized</td></tr>    <tr><td valign="top"></td><td valign="top"><em>buffer</em>&nbsp;</td><td>(char *) A pointer to the input buffer for the protosocket.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>buffersize</em>&nbsp;</td><td>(unsigned int) The size of the input buffer. </td></tr>  </table></dl><dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="a00036.html#a108">hello-world.c</a>, and <a class="el" href="a00038.html#a193">smtp.c</a>.</dl><p>Definition at line <a class="el" href="a00193.html#l00144">144</a> of file <a class="el" href="a00193.html">psock.h</a>.<p>Referenced by <a class="el" href="a00170.html#l00055">hello_world_appcall()</a>, <a class="el" href="a00184.html#l00298">httpd_appcall()</a>, and <a class="el" href="a00174.html#l00233">smtp_send()</a>.    </td>  </tr></table><a class="anchor" name="g55ce98ea4d6f22e9d5068b904d4d2447"></a><!-- doxytag: member="psock.h::PSOCK_NEWDATA" ref="g55ce98ea4d6f22e9d5068b904d4d2447" args="(psock)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">#define PSOCK_NEWDATA          </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="a00082.html">psock</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Check if new data has arrived on a protosocket. <p>This macro is used in conjunction with the <a class="el" href="a00158.html#g2ebfe5c8a7f3173714efdf2df74fc392">PSOCK_WAIT_UNTIL()</a> macro to check if data has arrived on a protosocket.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>psock</em>&nbsp;</td><td>(struct psock *) A pointer to the protosocket. </td></tr>  </table></dl><p>Definition at line <a class="el" href="a00193.html#l00339">339</a> of file <a class="el" href="a00193.html">psock.h</a>.    </td>  </tr></table><a class="anchor" name="gd895ab98c54d9966ff554aa873151751"></a><!-- doxytag: member="psock.h::PSOCK_READBUF" ref="gd895ab98c54d9966ff554aa873151751" args="(psock)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -