Class: FCGI::Record

### Home Classes Methods

### In Files

- lib/fcgi.rb

### Parent

Object

### Methods

- ::class_for
- ::new
- ::parse_header
- #management_record?
- #serialize
- #version

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- FCGI
- FCGI::AbortRequestRecord
- FCGI::BeginRequestRecord
- FCGI::DataRecord
- FCGI::EndRequestRecord
- FCGI::FastCGISocket
- FCGI::GenericDataRecord
- FCGI::GetValuesRecord
- FCGI::ParamsRecord
- FCGI::Record
- FCGI::RecordBuffer
- FCGI::Request
- FCGI::Server
- FCGI::StdinDataRecord
- FCGI::StdoutDataRecord
- FCGI::UnknownTypeRecord
- FCGI::ValuesRecord

No matching classes.

# FCGI::Record

### Constants

HEADER_FORMAT

  uint8_t protocol_version; uint8_t record_type; uint16_t request_id; (big endian) uint16_t content_length; (big endian) uint8_t padding_length; uint8_t reserved;

HEADER_LENGTH
RECORD_CLASS

### Attributes

request_id[R]
type[R]

### Public Class Methods

class_for(type) click to toggle source

    # File lib/fcgi.rb, line 318
    def self.class_for(type)
      RECORD_CLASS[type]
    end

new(type, reqid) click to toggle source

    # File lib/fcgi.rb, line 322
    def initialize(type, reqid)
      @type = type
      @request_id = reqid
    end

parse_header(buf) click to toggle source

    # File lib/fcgi.rb, line 314
    def self.parse_header(buf)
      return *buf.unpack(HEADER_FORMAT)
    end

### Public Instance Methods

management_record?() click to toggle source

    # File lib/fcgi.rb, line 334
    def management_record?
      @request_id == FCGI_NULL_REQUEST_ID
    end

serialize() click to toggle source

    # File lib/fcgi.rb, line 338
    def serialize
      body = make_body()
      padlen = body.length % 8
      header = make_header(body.length, padlen)
      header + body + "\0000" * padlen
    end

version() click to toggle source

    # File lib/fcgi.rb, line 327
    def version
      ::FCGI::ProtocolVersion
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.