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

📄 daemon.html

📁 perl教程
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<dt><strong>$c-&gt;read_buffer( $new_value )</strong>

<dd>
<p>Bytes read by $c-&gt;get_request, but not used are placed in the <em>read
buffer</em>.  The next time $c-&gt;get_request is called it will consume the
bytes in this buffer before reading more data from the network
connection itself.  The read buffer is invalid after $c-&gt;get_request
has failed.</p>
</dd>
<dd>
<p>If you handle the reading of the request content yourself you need to
empty this buffer before you read more and you need to place
unconsumed bytes here.  You also need this buffer if you implement
services like <em>101 Switching Protocols</em>.</p>
</dd>
<dd>
<p>This method always return the old buffer content and can optionally
replace the buffer content if you pass it an argument.</p>
</dd>
</li>
<dt><strong><a name="item_reason">$c-&gt;reason</a></strong>

<dd>
<p>When $c-&gt;get_request returns <a href="../../lib/Pod/perlfunc.html#item_undef"><code>undef</code></a> you can obtain a short string
describing why it happened by calling $c-&gt;reason.</p>
</dd>
</li>
<dt><strong><a name="item_proto_ge">$c-&gt;proto_ge( $proto )</a></strong>

<dd>
<p>Return TRUE if the client announced a protocol with version number
greater or equal to the given argument.  The $proto argument can be a
string like &quot;HTTP/1.1&quot; or just &quot;1.1&quot;.</p>
</dd>
</li>
<dt><strong><a name="item_antique_client">$c-&gt;antique_client</a></strong>

<dd>
<p>Return TRUE if the client speaks the HTTP/0.9 protocol.  No status
code and no headers should be returned to such a client.  This should
be the same as !$c-&gt;proto_ge(&quot;HTTP/1.0&quot;).</p>
</dd>
</li>
<dt><strong><a name="item_head_request">$c-&gt;head_request</a></strong>

<dd>
<p>Return TRUE if the last request was a <code>HEAD</code> request.  No content
body must be generated for these requests.</p>
</dd>
</li>
<dt><strong><a name="item_force_last_request">$c-&gt;force_last_request</a></strong>

<dd>
<p>Make sure that $c-&gt;get_request will not try to read more requests off
this connection.  If you generate a response that is not self
delimiting, then you should signal this fact by calling this method.</p>
</dd>
<dd>
<p>This attribute is turned on automatically if the client announces
protocol HTTP/1.0 or worse and does not include a &quot;Connection:
Keep-Alive&quot; header.  It is also turned on automatically when HTTP/1.1
or better clients send the &quot;Connection: close&quot; request header.</p>
</dd>
</li>
<dt><strong><a name="item_send_status_line">$c-&gt;send_status_line</a></strong>

<dt><strong>$c-&gt;send_status_line( $code )</strong>

<dt><strong>$c-&gt;send_status_line( $code, $mess )</strong>

<dt><strong>$c-&gt;send_status_line( $code, $mess, $proto )</strong>

<dd>
<p>Send the status line back to the client.  If $code is omitted 200 is
assumed.  If $mess is omitted, then a message corresponding to $code
is inserted.  If $proto is missing the content of the
$HTTP::Daemon::PROTO variable is used.</p>
</dd>
</li>
<dt><strong><a name="item_send_crlf">$c-&gt;send_crlf</a></strong>

<dd>
<p>Send the CRLF sequence to the client.</p>
</dd>
</li>
<dt><strong><a name="item_send_basic_header">$c-&gt;send_basic_header</a></strong>

<dt><strong>$c-&gt;send_basic_header( $code )</strong>

<dt><strong>$c-&gt;send_basic_header( $code, $mess )</strong>

<dt><strong>$c-&gt;send_basic_header( $code, $mess, $proto )</strong>

<dd>
<p>Send the status line and the &quot;Date:&quot; and &quot;Server:&quot; headers back to
the client.  This header is assumed to be continued and does not end
with an empty CRLF line.</p>
</dd>
<dd>
<p>See the description of <a href="#item_send_status_line"><code>send_status_line()</code></a> for the description of the
accepted arguments.</p>
</dd>
</li>
<dt><strong><a name="item_send_response">$c-&gt;send_response( $res )</a></strong>

<dd>
<p>Write a <code>HTTP::Response</code> object to the
client as a response.  We try hard to make sure that the response is
self delimiting so that the connection can stay persistent for further
request/response exchanges.</p>
</dd>
<dd>
<p>The content attribute of the <code>HTTP::Response</code> object can be a normal
string or a subroutine reference.  If it is a subroutine, then
whatever this callback routine returns is written back to the
client as the response content.  The routine will be called until it
return an undefined or empty value.  If the client is HTTP/1.1 aware
then we will use chunked transfer encoding for the response.</p>
</dd>
</li>
<dt><strong><a name="item_send_redirect">$c-&gt;send_redirect( $loc )</a></strong>

<dt><strong>$c-&gt;send_redirect( $loc, $code )</strong>

<dt><strong>$c-&gt;send_redirect( $loc, $code, $entity_body )</strong>

<dd>
<p>Send a redirect response back to the client.  The location ($loc) can
be an absolute or relative URL. The $code must be one the redirect
status codes, and defaults to &quot;301 Moved Permanently&quot;</p>
</dd>
</li>
<dt><strong><a name="item_send_error">$c-&gt;send_error</a></strong>

<dt><strong>$c-&gt;send_error( $code )</strong>

<dt><strong>$c-&gt;send_error( $code, $error_message )</strong>

<dd>
<p>Send an error response back to the client.  If the $code is missing a
&quot;Bad Request&quot; error is reported.  The $error_message is a string that
is incorporated in the body of the HTML entity body.</p>
</dd>
</li>
<dt><strong><a name="item_send_file_response">$c-&gt;send_file_response( $filename )</a></strong>

<dd>
<p>Send back a response with the specified $filename as content.  If the
file is a directory we try to generate an HTML index of it.</p>
</dd>
</li>
<dt><strong><a name="item_send_file">$c-&gt;send_file( $filename )</a></strong>

<dt><strong>$c-&gt;send_file( $fd )</strong>

<dd>
<p>Copy the file to the client.  The file can be a string (which
will be interpreted as a filename) or a reference to an <code>IO::Handle</code>
or glob.</p>
</dd>
</li>
<dt><strong><a name="item_daemon">$c-&gt;daemon</a></strong>

<dd>
<p>Return a reference to the corresponding <code>HTTP::Daemon</code> object.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p>RFC 2616</p>
<p><a href="../../lib/IO/Socket/INET.html">the IO::Socket::INET manpage</a>, <a href="../../lib/IO/Socket.html">the IO::Socket manpage</a></p>
<p>
</p>
<hr />
<h1><a name="copyright">COPYRIGHT</a></h1>
<p>Copyright 1996-2003, Gisle Aas</p>
<p>This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.</p>

</body>

</html>

⌨️ 快捷键说明

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