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

📄 a00163.html

📁 UIP完整的协议栈
💻 HTML
📖 第 1 页 / 共 3 页
字号:
Open an HTTP connection to a web server and ask for a file using the GET method. <p>This function opens an HTTP connection to the specified web server and requests the specified file using the GET method. When the HTTP connection has been connected, the <a class="el" href="a00163.html#g6b942c1ef22f8cd1a726ef3364c9fbea">webclient_connected()</a> callback function is called and when the HTTP data arrives the <a class="el" href="a00163.html#gc4b119801e50cc1824498a1cdf9adc37">webclient_datahandler()</a> callback function is called.<p>The callback function <a class="el" href="a00163.html#g23705efb9077187881f094fc9be13bde">webclient_timedout()</a> is called if the web server could not be contacted, and the <a class="el" href="a00163.html#gf11d9915ec12a8cdd9fdcbb5e8fcd5c7">webclient_aborted()</a> callback function is called if the HTTP connection is aborted by the web server.<p>When the HTTP request has been completed and the HTTP connection is closed, the <a class="el" href="a00163.html#gf8f12c820cc08da32aa62898bfc02db3">webclient_closed()</a> callback function will be called.<p><dl compact><dt><b>Note:</b></dt><dd>If the function is passed a host name, it must already be in the resolver cache in order for the function to connect to the web server. It is therefore up to the calling module to implement the resolver calls and the signal handler used for reporting a resolv query answer.</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>host</em>&nbsp;</td><td>A pointer to a string containing either a host name or a numerical IP address in dotted decimal notation (e.g., 192.168.23.1).</td></tr>    <tr><td valign="top"></td><td valign="top"><em>port</em>&nbsp;</td><td>The port number to which to connect, in host byte order.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>file</em>&nbsp;</td><td>A pointer to the name of the file to get.</td></tr>  </table></dl><dl compact><dt><b>Return values:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>0</em>&nbsp;</td><td>if the host name could not be found in the cache, or if a TCP connection could not be created.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>1</em>&nbsp;</td><td>if the connection was initiated. </td></tr>  </table></dl><dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="a00040.html#a268">webclient.c</a>, and <a class="el" href="a00041.html#a324">webclient.h</a>.</dl><p>Definition at line <a class="el" href="a00180.html#l00140">140</a> of file <a class="el" href="a00180.html">webclient.c</a>.<p>References <a class="el" href="a00181.html#l00062">webclient_state::file</a>, <a class="el" href="a00181.html#l00061">webclient_state::host</a>, <a class="el" href="a00201.html#l01882">htons()</a>, <a class="el" href="a00172.html#l00069">NULL</a>, <a class="el" href="a00181.html#l00060">webclient_state::port</a>, <a class="el" href="a00172.html#l00396">resolv_lookup()</a>, and <a class="el" href="a00201.html#l00407">uip_connect()</a>.<p>Referenced by <a class="el" href="a00180.html#l00378">webclient_appcall()</a>.    </td>  </tr></table><a class="anchor" name="g0e0ea5f24b77f124ba33bcbc7ede5bfb"></a><!-- doxytag: member="webclient.h::webclient_hostname" ref="g0e0ea5f24b77f124ba33bcbc7ede5bfb" args="(void)" --><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">char * webclient_hostname           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void&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>Obtain the hostname of the current HTTP data stream. <p>The hostname of the web server of an HTTP request may be changed by the web server, and may therefore not be the same as when the original GET request was made with <a class="el" href="a00163.html#gf9385ef9ecc74c7d53ff2f15e62bfde3">webclient_get()</a>. This function is used for obtaining the current hostname.<p><dl compact><dt><b>Returns:</b></dt><dd>A pointer to the current hostname. </dd></dl><dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="a00040.html#a256">webclient.c</a>, and <a class="el" href="a00041.html#a329">webclient.h</a>.</dl><p>Definition at line <a class="el" href="a00180.html#l00099">99</a> of file <a class="el" href="a00180.html">webclient.c</a>.<p>References <a class="el" href="a00181.html#l00061">webclient_state::host</a>.    </td>  </tr></table><a class="anchor" name="g4433d3af16ea083a81576d0f18ba57c9"></a><!-- doxytag: member="webclient.h::webclient_mimetype" ref="g4433d3af16ea083a81576d0f18ba57c9" args="(void)" --><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">char * webclient_mimetype           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void&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>Obtain the MIME type of the current HTTP data stream. <p><dl compact><dt><b>Returns:</b></dt><dd>A pointer to a string contaning the MIME type. The string may be empty if no MIME type was reported by the web server. </dd></dl><dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="a00040.html#a252">webclient.c</a>, and <a class="el" href="a00041.html#a327">webclient.h</a>.</dl><p>Definition at line <a class="el" href="a00180.html#l00087">87</a> of file <a class="el" href="a00180.html">webclient.c</a>.<p>References <a class="el" href="a00181.html#l00069">webclient_state::mimetype</a>.    </td>  </tr></table><a class="anchor" name="g2a939aa4fcffabbce1dc1f784a7e0ad3"></a><!-- doxytag: member="webclient.h::webclient_port" ref="g2a939aa4fcffabbce1dc1f784a7e0ad3" args="(void)" --><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">unsigned short webclient_port           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void&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>Obtain the port number of the current HTTP data stream. <p>The port number of an HTTP request may be changed by the web server, and may therefore not be the same as when the original GET request was made with <a class="el" href="a00163.html#gf9385ef9ecc74c7d53ff2f15e62bfde3">webclient_get()</a>. This function is used for obtaining the current port number.<p><dl compact><dt><b>Returns:</b></dt><dd>The port number of the current HTTP data stream, in host byte order. </dd></dl><dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="a00040.html#a258">webclient.c</a>, and <a class="el" href="a00041.html#a330">webclient.h</a>.</dl><p>Definition at line <a class="el" href="a00180.html#l00105">105</a> of file <a class="el" href="a00180.html">webclient.c</a>.<p>References <a class="el" href="a00181.html#l00060">webclient_state::port</a>.    </td>  </tr></table><a class="anchor" name="g23705efb9077187881f094fc9be13bde"></a><!-- doxytag: member="webclient.h::webclient_timedout" ref="g23705efb9077187881f094fc9be13bde" args="(void)" --><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">void webclient_timedout           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void&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>Callback function that is called from the webclient code if the HTTP connection to the web server has timed out. <p>This function must be implemented by the module that uses the webclient code. <dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="a00040.html#a299">webclient.c</a>, and <a class="el" href="a00041.html#a320">webclient.h</a>.</dl><p>Referenced by <a class="el" href="a00180.html#l00378">webclient_appcall()</a>.    </td>  </tr></table><hr size="1"><address style="align: right;"><small>Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address></body></html>

⌨️ 快捷键说明

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