Class: Baykit::BayServer::Docker::Fcgi::FcgPacket

Inherits:
Protocol::Packet
  • Object
show all
Defined in:
lib/baykit/bayserver/docker/fcgi/fcg_packet.rb

Constant Summary collapse

PREAMBLE_SIZE =
8
VERSION =
1
MAXLEN =
65535
FCGI_NULL_REQUEST_ID =
0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ FcgPacket

Returns a new instance of FcgPacket.



37
38
39
40
# File 'lib/baykit/bayserver/docker/fcgi/fcg_packet.rb', line 37

def initialize(type)
  super(type, PREAMBLE_SIZE, MAXLEN)
  @version = VERSION
end

Instance Attribute Details

#req_idObject

Returns the value of attribute req_id.



35
36
37
# File 'lib/baykit/bayserver/docker/fcgi/fcg_packet.rb', line 35

def req_id
  @req_id
end

#versionObject (readonly)

Returns the value of attribute version.



34
35
36
# File 'lib/baykit/bayserver/docker/fcgi/fcg_packet.rb', line 34

def version
  @version
end

Instance Method Details

#resetObject



42
43
44
45
46
# File 'lib/baykit/bayserver/docker/fcgi/fcg_packet.rb', line 42

def reset()
  super
  @version = VERSION
  @req_id = 0
end

#to_sObject



48
49
50
# File 'lib/baykit/bayserver/docker/fcgi/fcg_packet.rb', line 48

def to_s
  "FcgPacket(#{@type}) id=#{@req_id}"
end