NAME

Net::FastCGI::RecordFactory - Factory for Net::FastCGI::Record objects.

SYNOPSIS

# Constructor
$factory = Net::FastCGI::RecordFactory->new;

# Methods

# FCGI_ABORT_REQUEST
$record = $factory->create_abort_request($request_id);

# FCGI_BEGIN_REQUEST
$record = $factory->create_begin_request($request_id, $role, $flags);

# FCGI_END_REQUEST
$record = $factory->create_end_request($request_id, $application_status, $protocol_status);

# FCGI_PARAMS
$record = $factory->create_params($request_id);
$record = $factory->create_params($request_id, $content);

# FCGI_STDIN
$record = $factory->create_stdin($request_id);
$record = $factory->create_stdin($request_id, $content);

# FCGI_STDOUT
$record = $factory->create_stdout($request_id);
$record = $factory->create_stdout($request_id, $content);

# FCGI_STDERR
$record = $factory->create_stderr($request_id);
$record = $factory->create_stderr($request_id, $content);

# FCGI_DATA
$record = $factory->create_data($request_id);
$record = $factory->create_data($request_id, $content);

# FCGI_UNKNOWN_TYPE
$record = $factory->create_unknown_type($unknown_type);

# FCGI_GET_VALUES
$record = $factory->create_get_values;
$record = $factory->create_get_values($values);

# FCGI_GET_VALUES_RESULT
$record = $factory->create_get_values_result($values);

$record = $factory->parse($type, $request_id);
$record = $factory->parse($type, $request_id, $content);

DESCRIPTION

CONSTRUCTORS

new

Constructs an instance of Net::FastCGI::RecordFactory.

Usage

$factory = Net::FastCGI::RecordFactory->new;

Returns

$factory

An instance of Net::FastCGI::RecordFactory.

METHODS

create_abort_request

Creates a FCGI_ABORT_REQUEST record.

Usage

$record = $factory->create_abort_request($request_id);

Arguments

$request_id

An unsigned 16-bit integer.

Returns

$record

An instance of Net::FastCGI::Record.

create_begin_request

Creates a FCGI_BEGIN_REQUEST record.

Usage

$record = $factory->create_begin_request($request_id, $role, $flags);

Arguments

$request_id

An unsigned 16-bit integer.

$role

An unsigned 16-bit integer.

$flags

An unsigned 8-bit integer.

Returns

$record

An instance of Net::FastCGI::Record::BeginRequest.

create_end_request

Creates a FCGI_END_REQUEST record.

Usage

$record = $factory->create_end_request($request_id, $application_status, $protocol_status);

Arguments

$request_id

An unsigned 16-bit integer.

$application_status

An unsigned 16-bit integer.

$protocol_status

An unsigned 8-bit integer.

Returns

$record

An instance of Net::FastCGI::Record::EndRequest.

create_stream

Creates a stream record.

Usage

$record = $factory->create_stream($type, $request_id);
$record = $factory->create_stream($type, $request_id, $content);

Arguments

$type

An unsigned 8-bit integer.

$request_id

An unsigned 16-bit integer.

$content (optional)

A string of octets containing the body, must be less than or equal to 65535 octets in length.

Returns

$record

An instance of Net::FastCGI::Record::Stream.

create_params

Creates a FCGI_PARAMS stream record.

Usage

$record = $factory->create_params($request_id);
$record = $factory->create_params($request_id, $content);

Arguments

$request_id

An unsigned 16-bit integer.

$content (optional)

A string of octets containing the body, must be less than or equal to 65535 octets in length.

Returns

$record

An instance of Net::FastCGI::Record::Stream.

create_stdin

Creates a FCGI_STDIN stream record.

Usage

$record = $factory->create_stdin($request_id);
$record = $factory->create_stdin($request_id, $content);

Arguments

$request_id

An unsigned 16-bit integer.

$content (optional)

A string of octets containing the body, must be less than or equal to 65535 octets in length.

Returns

$record

An instance of Net::FastCGI::Record::Stream.

create_stdout

Creates a FCGI_STDOUT stream record.

Usage

$record = $factory->create_stdout($request_id);
$record = $factory->create_stdout($request_id, $content);

Arguments

$request_id

An unsigned 16-bit integer.

$content (optional)

A string of octets containing the body, must be less than or equal to 65535 octets in length.

Returns

$record

An instance of Net::FastCGI::Record::Stream.

create_stderr

Creates a FCGI_STDERR stream record.

Usage

$record = $factory->create_stderr($request_id);
$record = $factory->create_stderr($request_id, $content);

Arguments

$request_id

An unsigned 16-bit integer.

$content (optional)

A string of octets containing the body, must be less than or equal to 65535 octets in length.

Returns

$record

An instance of Net::FastCGI::Record::Stream.

create_data

Creates a FCGI_DATA stream record.

Usage

$record = $factory->create_data($request_id);
$record = $factory->create_data($request_id, $content);

Arguments

$request_id

An unsigned 16-bit integer.

$content (optional)

A string of octets containing the body, must be less than or equal to 65535 octets in length.

Returns

$record

An instance of Net::FastCGI::Record::Stream.

create_unknown_type

Creates a FCGI_UNKNOWN_TYPE record.

Usage

$record = $factory->create_unknown_type($unknown_type);

Arguments

$unknown_type

An unsigned 8-bit integer.

Returns

$record

An instance of Net::FastCGI::Record::UnknownType.

create_values

Creates a values record.

Usage

$record = $factory->create_values($type, $values);

Arguments

$type

An unsigned 8-bit integer.

$values

A hash reference containing name/value pairs.

Returns

$record

An instance of Net::FastCGI::Record::Values.

create_get_values

Creates a FCGI_GET_VALUES record.

Usage

$record = $factory->create_get_values;
$record = $factory->create_get_values($values);

Arguments

$values (optional)

A hash reference containing name/value pairs.

Returns

$record

An instance of Net::FastCGI::Record::Values.

create_get_values_result

Creates a FCGI_GET_VALUES_RESULT record.

Usage

$record = $factory->create_get_values_result($values);

Arguments

$values

A hash reference containing name/value pairs.

Returns

$record

An instance of Net::FastCGI::Record::Values.

parse

Parses a record body.

Usage

$record = $factory->parse($type, $request_id);
$record = $factory->parse($type, $request_id, $content);

Arguments

$type

An unsigned 8-bit integer.

$request_id

An unsigned 16-bit integer.

$content (optional)

A string of octets containing the body.

Returns

$record

An instance of Net::FastCGI::Record.

EXPORTS

None.

SEE ALSO

Net::FastCGI::Record
Net::FastCGI::Record::BeginRequest
Net::FastCGI::Record::EndRequest
Net::FastCGI::Record::Stream
Net::FastCGI::Record::UnknownType
Net::FastCGI::Record::Values

AUTHOR

Christian Hansen chansen@cpan.org

COPYRIGHT

Copyright (c) 2008 Christian Hansen. All rights reserved.

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.