Syntax-K

Know-How für Ihr Projekt

Perl Documentation

NAME

AxKit2::Connection - The client/connection side class.

DESCRIPTION

This class implements a single connection to the AxKit server.

It is a subclass of Danga::Socket. See Danga::Socket for the APIs available to this class.

API

$obj->uptime

Return the uptime for this connection in seconds (fractional)

$obj->paused

Returns true if this connection is "paused".

$obj->pause_read

Suspend reading from this client.

$obj->continue_read

Continue reading from this client. This is stacked, so two calls to pause_read and one call to continue_read will not result in a continue.

These two calls are mainly used internally for continuations and 99.9% of the time you should not be calling them.

$obj->config

Retrieve the current config object for this request. Note that this may return a different config object in different phases of the request because the config object can be dependant on the URI.

$obj->notes( KEY [, VALUE ] )

Get/Set a custom key/value pair for this connection.

$obj->headers_out( [ NEW_HEADERS ] )

Get/set the response header object.

See AxKit2::HTTPHeaders.

$obj->headers_in

Get the request header object.

See AxKit2::HTTPHeaders.

$obj->param( ARGS )

A shortcut for $obj->headers_in->param( ARGS ). See AxKit2::HTTPHeaders for details.

$obj->send_http_headers

Send the response headers to the browser.

$obj->http_headers_sent

Returns true if headers have already been sent.

$obj->internal_redirect($path)

Redirect the currently running request. This is similar (but not identical) to Apache's internal redirects. Connection state is kept as-is, except for setting a new request_uri and loading the matching configuration settings. Then, processing will start with hook_uri_translation again.

The caller should return the return value of this function.

$obj->redirect($uri [, $code])

Redirect the current request by sending a HTTP redirect response. If no code is given, a "302 Found" is sent, which is rather unspecific.

For pre-HTTP/1.1 clients, 303 and 307 codes are mapped to 302 for compatibility. This might yield unwanted results for POST requests, since HTTP/1.0 clients tend to misinterpret the RFC. There's no better alternative, so avoid redirecting POST requests if this is a problem.

The caller should return the return value of this function.