(PECL event >= 1.8.0)
EventHttpConnection::setCloseCallback — Set callback for connection close
Sets callback for connection close.
callback
Callback which is called when connection is closed. Should match the following prototype:
No devuelve ningún valor.
Ejemplo #1 EventHttpConnection::setCloseCallback() example
<?php
function _close_callback($conn)
{
echo __FUNCTION__, PHP_EOL;
}
function _http_default($req, $dummy)
{
$conn = $req->getConnection();
$conn->setCloseCallback('_close_callback', NULL);
$bev = $req->getBufferEvent();
$bev->enable(Event::READ);
// We have to free it explicitly. See
$bev->free();