In Files

Parent

FCGI::FastCGISocket

Public Class Methods

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

Public Instance Methods

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

Private Instance Methods

read_record_body(clen, padlen) click to toggle source
     # File lib/fcgi.rb, line 198
198:       def read_record_body(clen, padlen)
199:         buf = ''
200:         while buf.length < clen
201:           buf << @socket.read([1024, clen - buf.length].min)
202:         end
203:         @socket.read padlen if padlen
204:         buf
205:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.