Class: Baykit::BayServer::Docker::Fcgi::FcgCommand
- Inherits:
-
Protocol::Command
- Object
- Protocol::Command
- Baykit::BayServer::Docker::Fcgi::FcgCommand
- Defined in:
- lib/baykit/bayserver/docker/fcgi/fcg_command.rb
Direct Known Subclasses
Command::CmdBeginRequest, Command::CmdEndRequest, Command::CmdParams, Command::InOutCommandBase
Instance Attribute Summary collapse
-
#req_id ⇒ Object
readonly
Returns the value of attribute req_id.
Instance Method Summary collapse
-
#initialize(type, req_id) ⇒ FcgCommand
constructor
A new instance of FcgCommand.
-
#pack(pkt) ⇒ Object
Super class method must be called from last line of override method since header cannot be packed before data is constructed.
- #pack_header(pkt) ⇒ Object
- #unpack(pkt) ⇒ Object
Constructor Details
#initialize(type, req_id) ⇒ FcgCommand
Returns a new instance of FcgCommand.
9 10 11 12 |
# File 'lib/baykit/bayserver/docker/fcgi/fcg_command.rb', line 9 def initialize(type, req_id) super(type) @req_id = req_id end |
Instance Attribute Details
#req_id ⇒ Object (readonly)
Returns the value of attribute req_id.
7 8 9 |
# File 'lib/baykit/bayserver/docker/fcgi/fcg_command.rb', line 7 def req_id @req_id end |
Instance Method Details
#pack(pkt) ⇒ Object
Super class method must be called from last line of override method since header cannot be packed before data is constructed
22 23 24 25 |
# File 'lib/baykit/bayserver/docker/fcgi/fcg_command.rb', line 22 def pack(pkt) pkt.req_id = @req_id pack_header(pkt) end |
#pack_header(pkt) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/baykit/bayserver/docker/fcgi/fcg_command.rb', line 27 def pack_header(pkt) acc = pkt.new_header_accessor() acc.put_byte(pkt.version) acc.put_byte(pkt.type) acc.put_short(pkt.req_id) acc.put_short(pkt.data_len) acc.put_byte(0) # paddinglen acc.put_byte(0) # reserved end |
#unpack(pkt) ⇒ Object
14 15 16 |
# File 'lib/baykit/bayserver/docker/fcgi/fcg_command.rb', line 14 def unpack(pkt) @req_id = pkt.req_id end |