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

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

Instance Attribute Summary collapse

Attributes inherited from H2Command

#flags, #stream_id

Instance Method Summary collapse

Constructor Details

#initialize(stream_id, flags = nil) ⇒ CmdContinuation

Returns a new instance of CmdContinuation.



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

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

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



25
26
27
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_continuation.rb', line 25

def data
  @data
end

#lengthObject (readonly)

Returns the value of attribute length.



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

def length
  @length
end

#startObject (readonly)

This class refers external byte array, so this IS NOT mutable



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

def start
  @start
end

Instance Method Details

#handle(cmd_handler) ⇒ Object



47
48
49
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_continuation.rb', line 47

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

#pack(pkt) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_continuation.rb', line 38

def pack(pkt)
  acc = pkt.new_data_accessor()
  if @flags.padded?
    raise RuntimeError.new("Padding not supported")
  end
  acc.put_bytes(@data, @start, @length)
  super
end

#unpack(pkt) ⇒ Object



31
32
33
34
35
36
# File 'lib/baykit/bayserver/docker/http/h2/command/cmd_continuation.rb', line 31

def unpack(pkt)
  super
  @data = pkt.buf
  @start = pkt.header_len
  @length = pkt.data_len()
end