Class: Baykit::BayServer::Docker::Http::H2::Command::CmdRstStream

Inherits:
H2Command
  • Object
show all
Includes:
Baykit::BayServer::Docker::Http::H2
Defined in:
lib/baykit/bayserver/docker/http/h2/command/cmd_rst_stream.rb

Instance Attribute Summary collapse

Attributes inherited from H2Command

#flags, #stream_id

Instance Method Summary collapse

Constructor Details

#initialize(stream_id, flags = nil) ⇒ CmdRstStream

Returns a new instance of CmdRstStream.



23
24
25
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_rst_stream.rb', line 23

def initialize(stream_id, flags=nil)
   super(H2Type::RST_STREAM, stream_id, flags)
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



21
22
23
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_rst_stream.rb', line 21

def error_code
  @error_code
end

Instance Method Details

#handle(cmd_handler) ⇒ Object



39
40
41
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_rst_stream.rb', line 39

def handle(cmd_handler)
  return cmd_handler.handle_rst_stream(self)
end

#pack(pkt) ⇒ Object



33
34
35
36
37
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_rst_stream.rb', line 33

def pack(pkt)
  acc = pkt.new_data_accessor
  acc.put_int(@error_code)
  super
end

#unpack(pkt) ⇒ Object



27
28
29
30
31
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_rst_stream.rb', line 27

def unpack(pkt)
  super
  acc = pkt.new_data_accessor
  @error_code = acc.get_int
end