Class: Baykit::BayServer::Docker::Http::H2::Command::CmdGoAway
- Inherits:
-
H2Command
- Object
- Protocol::Command
- H2Command
- Baykit::BayServer::Docker::Http::H2::Command::CmdGoAway
- Includes:
- Baykit::BayServer::Docker::Http::H2, Util
- Defined in:
- lib/baykit/bayserver/docker/http/h2/command/cmd_go_away.rb
Instance Attribute Summary collapse
-
#debug_data ⇒ Object
Returns the value of attribute debug_data.
-
#error_code ⇒ Object
Returns the value of attribute error_code.
-
#last_stream_id ⇒ Object
Returns the value of attribute last_stream_id.
Attributes inherited from H2Command
Instance Method Summary collapse
- #handle(cmd_handler) ⇒ Object
-
#initialize(stream_id, flags = nil) ⇒ CmdGoAway
constructor
A new instance of CmdGoAway.
- #pack(pkt) ⇒ Object
- #unpack(pkt) ⇒ Object
Constructor Details
Instance Attribute Details
#debug_data ⇒ Object
Returns the value of attribute debug_data.
30 31 32 |
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_go_away.rb', line 30 def debug_data @debug_data end |
#error_code ⇒ Object
Returns the value of attribute error_code.
29 30 31 |
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_go_away.rb', line 29 def error_code @error_code end |
#last_stream_id ⇒ Object
Returns the value of attribute last_stream_id.
28 29 30 |
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_go_away.rb', line 28 def last_stream_id @last_stream_id end |
Instance Method Details
#handle(cmd_handler) ⇒ Object
56 57 58 |
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_go_away.rb', line 56 def handle(cmd_handler) return cmd_handler.handle_go_away(self) end |
#pack(pkt) ⇒ Object
46 47 48 49 50 51 52 53 54 |
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_go_away.rb', line 46 def pack(pkt) acc = pkt.new_data_accessor() acc.put_int(@last_stream_id) acc.put_int(@error_code) if @debug_data != nil acc.put_bytes(@debug_data, 0, @debug_data.length) end super end |
#unpack(pkt) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_go_away.rb', line 36 def unpack(pkt) super acc = pkt.new_data_accessor val = acc.get_int @last_stream_id = H2Packet.extract_int31(val) @error_code = acc.get_int @debug_data = StringUtil.alloc(pkt.data_len() - acc.pos) acc.get_bytes(@debug_data, 0, @debug_data.length) end |