<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Returns underlying output buffer associated with current buffer event</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="eventbufferevent.getinput.html">EventBufferEvent::getInput</a></div> <div class="next" style="text-align: right; float: right;"><a href="eventbufferevent.read.html">EventBufferEvent::read</a></div> <div class="up"><a href="class.eventbufferevent.html">EventBufferEvent</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="eventbufferevent.getoutput" class="refentry"> <div class="refnamediv"> <h1 class="refname">EventBufferEvent::getOutput</h1> <p class="verinfo">(PECL event >= 1.2.6-beta)</p><p class="refpurpose"><span class="refname">EventBufferEvent::getOutput</span> — <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">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type"><a href="class.eventbuffer.html" class="type EventBuffer">EventBuffer</a></span> <span class="methodname"><strong>EventBufferEvent::getOutput</strong></span> ( <span class="methodparam">void</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 <em> <a href="class.eventbufferevent.html#eventbufferevent.props.output" class="link">output</a> </em> property of <a href="class.eventbufferevent.html" class="classname">EventBufferEvent</a> class. </p> </div> <div class="refsect1 parameters" id="refsect1-eventbufferevent.getoutput-parameters"> <h3 class="title">Parameters</h3> <p class="para">This function has no parameters.</p> </div> <div class="refsect1 returnvalues" id="refsect1-eventbufferevent.getoutput-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns instance of <a href="class.eventbuffer.html" class="classname">EventBuffer</a> output buffer associated with current buffer event. </p> </div> <div class="refsect1 examples" id="refsect1-eventbufferevent.getoutput-examples"> <h3 class="title">Examples</h3> <div class="example" id="example-4255"> <p><strong>Example #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"><?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">-></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">-></span><span style="color: #0000BB">getOutput</span><span style="color: #007700">();<br />if (!</span><span style="color: #0000BB">$output</span><span style="color: #007700">-></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">?></span> </span> </code></div> </div> </div> </div> <div class="refsect1 seealso" id="refsect1-eventbufferevent.getoutput-seealso"> <h3 class="title">See Also</h3> <ul class="simplelist"> <li class="member"> <span class="methodname"><a href="eventbufferevent.getinput.html" class="methodname" rel="rdfs-seeAlso">EventBufferEvent::getInput()</a> - Returns underlying input buffer associated with current buffer event</span> </li> </ul> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="eventbufferevent.getinput.html">EventBufferEvent::getInput</a></div> <div class="next" style="text-align: right; float: right;"><a href="eventbufferevent.read.html">EventBufferEvent::read</a></div> <div class="up"><a href="class.eventbufferevent.html">EventBufferEvent</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>