[pecl][event] synced with version event-1.11.2

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@335200 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Ruslan Osmanov 2014-11-20 09:57:42 +00:00
parent 6db778461e
commit e5d7cfa894
2 changed files with 15 additions and 1 deletions

View file

@ -128,12 +128,16 @@ function _http_default($req, $dummy)
58:php 15057 ruslan 7u IPv4 125189 0t0 TCP *:4242 (LISTEN)
59:php 15057 ruslan 8u IPv4 124342 0t0 TCP localhost:4242->localhost:37375 (CLOSE_WAIT)
where $PID is our process ID.
where $PID is our process ID.
The following block of code fixes such kind of orphaned connections.
*/
$bev = $req->getBufferEvent();
$bev->enable(Event::READ);
// We have to free it explicitly. See ]]>
<methodname>EventHttpRequest::getConnection</methodname>
<![CDATA[
$bev->free(); // we have to free it explicitly
$req->addHeader(
'Content-Type',

View file

@ -18,6 +18,16 @@
<classname>EventBufferEvent</classname>
object which represents buffer event that the connection is using.
</para>
<warning>
<para>
The reference counter of the returned object will be incremented by one to
protect internal structures against premature destruction when the method
is called from a user callback. So the
<classname>EventBufferEvent</classname> object should be freed explicitly
with <methodname>EventBufferEvent::free</methodname> method.
Otherwise memory will leak.
</para>
</warning>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;