<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.eventbufferevent.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'eventbufferevent.getoutput.php',
    1 => 'EventBufferEvent::getOutput',
    2 => 'Returns underlying output buffer associated with current buffer
  event',
  ),
  'up' => 
  array (
    0 => 'class.eventbufferevent.php',
    1 => 'EventBufferEvent',
  ),
  'prev' => 
  array (
    0 => 'eventbufferevent.getinput.php',
    1 => 'EventBufferEvent::getInput',
  ),
  'next' => 
  array (
    0 => 'eventbufferevent.read.php',
    1 => 'EventBufferEvent::read',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/event/eventbufferevent/getoutput.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="eventbufferevent.getoutput" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">EventBufferEvent::getOutput</h1>
  <p class="verinfo">(PECL event &gt;= 1.2.6-beta)</p><p class="refpurpose"><span class="refname">EventBufferEvent::getOutput</span> &mdash; <span class="dc-title">Returns underlying output buffer associated with current buffer
  event</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-eventbufferevent.getoutput-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><strong>EventBufferEvent::getOutput</strong></span>(): <span class="type"><a href="class.eventbuffer.php" class="type EventBuffer">EventBuffer</a></span></div>

  <p class="para rdfs-comment">
   Returns underlying output buffer associated with current buffer event. An
   output buffer is a storage for data to be written.
  </p>
  <p class="para">
   Note, there is also
   <code class="literal">
    <a href="class.eventbufferevent.php#eventbufferevent.props.output" class="link">output</a>
   </code>
   property of
   <span class="classname"><a href="class.eventbufferevent.php" class="classname">EventBufferEvent</a></span>
   class.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-eventbufferevent.getoutput-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-eventbufferevent.getoutput-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns instance of
   <span class="classname"><a href="class.eventbuffer.php" class="classname">EventBuffer</a></span>
   output buffer associated with current buffer event.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-eventbufferevent.getoutput-examples">
  <h3 class="title">示例</h3>
  <div class="example" id="example-1">
   <p><strong>示例 #1 
    <span class="function"><strong>EventBufferEvent::getOutput()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$base </span><span style="color: #007700">= new </span><span style="color: #0000BB">EventBase</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$dns_base </span><span style="color: #007700">= new </span><span style="color: #0000BB">EventDnsBase</span><span style="color: #007700">(</span><span style="color: #0000BB">$base</span><span style="color: #007700">, </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">); </span><span style="color: #FF8000">// Use async DNS resolving<br /></span><span style="color: #007700">if (!</span><span style="color: #0000BB">$dns_base</span><span style="color: #007700">) {<br />    exit(</span><span style="color: #DD0000">"Failed to init DNS Base\n"</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">$bev </span><span style="color: #007700">= new </span><span style="color: #0000BB">EventBufferEvent</span><span style="color: #007700">(</span><span style="color: #0000BB">$base</span><span style="color: #007700">, </span><span style="color: #FF8000">/* use internal socket */ </span><span style="color: #0000BB">NULL</span><span style="color: #007700">,<br />    </span><span style="color: #0000BB">EventBufferEvent</span><span style="color: #007700">::</span><span style="color: #0000BB">OPT_CLOSE_ON_FREE </span><span style="color: #007700">| </span><span style="color: #0000BB">EventBufferEvent</span><span style="color: #007700">::</span><span style="color: #0000BB">OPT_DEFER_CALLBACKS</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">"readcb"</span><span style="color: #007700">, </span><span style="color: #FF8000">/* writecb */ </span><span style="color: #0000BB">NULL</span><span style="color: #007700">, </span><span style="color: #DD0000">"eventcb"</span><span style="color: #007700">, </span><span style="color: #0000BB">$base<br /></span><span style="color: #007700">);<br />if (!</span><span style="color: #0000BB">$bev</span><span style="color: #007700">) {<br />    exit(</span><span style="color: #DD0000">"Failed creating bufferevent socket\n"</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">$bev</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">enable</span><span style="color: #007700">(</span><span style="color: #0000BB">Event</span><span style="color: #007700">::</span><span style="color: #0000BB">READ </span><span style="color: #007700">| </span><span style="color: #0000BB">Event</span><span style="color: #007700">::</span><span style="color: #0000BB">WRITE</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$output </span><span style="color: #007700">= </span><span style="color: #0000BB">$bev</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOutput</span><span style="color: #007700">();<br />if (!</span><span style="color: #0000BB">$output</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">add</span><span style="color: #007700">(<br />    </span><span style="color: #DD0000">"GET </span><span style="color: #007700">{</span><span style="color: #0000BB">$argv</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">]}</span><span style="color: #DD0000"> HTTP/1.0\r\n"</span><span style="color: #007700">.<br />    </span><span style="color: #DD0000">"Host: </span><span style="color: #007700">{</span><span style="color: #0000BB">$argv</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]}</span><span style="color: #DD0000">\r\n"</span><span style="color: #007700">.<br />    </span><span style="color: #DD0000">"Connection: Close\r\n\r\n"<br /></span><span style="color: #007700">)) {<br />    exit(</span><span style="color: #DD0000">"Failed adding request to output buffer\n"</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #FF8000">/* ... */<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>

 <div class="refsect1 seealso" id="refsect1-eventbufferevent.getoutput-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li>
    <span class="methodname"><a href="eventbufferevent.getinput.php" class="methodname" rel="rdfs-seeAlso">EventBufferEvent::getInput()</a> - Returns underlying input buffer associated with current buffer
  event</span>
   </li>
  </ul>
 </div>

</div><?php manual_footer($setup); ?>