class FCGI::FastCGISocket

Public Class Methods

new(sock) click to toggle source
# File lib/fcgi.rb, line 187
def initialize(sock)
  @socket = sock
end

Public Instance Methods

read_record() click to toggle source
# File lib/fcgi.rb, line 191
def read_record
  header = @socket.read(Record::HEADER_LENGTH) or return nil
  return nil unless header.size == Record::HEADER_LENGTH
  version, type, reqid, clen, padlen, reserved = *Record.parse_header(header)
  Record.class_for(type).parse(reqid, read_record_body(clen, padlen))
end
send_record(rec) click to toggle source
# File lib/fcgi.rb, line 208
def send_record(rec)
  @socket.write rec.serialize
  @socket.flush
end