4. The Apache Connection Class

The Apache Connection class contains information related to the network connection associated with the current request.

You can obtain the Connection instance associated with the current request using the Request::connection() method.

4.1. Method Documentation

Table B.3, “Apache Connection Methods” contains the exhaustive list of methods, in alphabetical order. The documentation of each method follows.

Table B.3. Apache Connection Methods

TypeNameArgs
method aborted() 0
method id() 0
method keepalive() 0
method local_host() 0
method local_ip() 0
method remote_host() 0
method remote_ip() 0
method remote_logname() 0


aborted()

aborted() returns 1 if the connection is open, 0 if it is closed.

id()

id() returns the unique (integer) ID of the current connection. It is assigned internally by Apache.

keepalive()

keepalive() returns 1 of the keepalive is enabled.

local_host()

local_host() is used for ap_get_server_name() when UseCanonicalName is set to DNS (ignores setting of HostnameLookups)

local_ip()

local_ip() returns a string containing the server's IP address.

remote_host()

remote_host() returns the client's DNS name, if known, or nil if DNS hasn't been checked. It returns "" if no address was found. N.B. only access this though get_remote_host().

remote_ip()

remote_ip() returns a string containing the remote IP address.

remote_logname()

remote_logname() is only ever set if doing rfc1413 lookups. It's better to access this through Request::get_remote_logname().