Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<EventHttpRequest::getCommandEventHttpRequest::getHost>
^EventHttpRequestLast updated: Mon, 26 Oct 2026

EventHttpRequest::getConnection

(PECL event >= 1.8.0)

EventHttpRequest::getConnection — Returns EventHttpConnection object

Description

Returns EventHttpConnection object which represents HTTP connection associated with the request.

Warning

Libevent API allows HTTP request objects to be not bound to any HTTP connection. Therefore we can't unambiguously associate EventHttpRequest with EventHttpConnection. Thus, we construct EventHttpConnection object on-the-fly. Having no information about the event base, DNS base and connection-close callback, we just leave these fields unset.

EventHttpRequest::getConnection() method is usually useful when we need to set up a callback on connection close. See EventHttpConnection::setCloseCallback().

Parameters

This function has no parameters.

Return Values

Returns EventHttpConnection object.

See Also


<EventHttpRequest::getCommandEventHttpRequest::getHost>
^EventHttpRequestLast updated: Mon, 26 Oct 2026