aboutsummaryrefslogtreecommitdiffstats
path: root/lib/plum/frame/window_update.rb
blob: 3fe5ecd0cf6d8df6dabbccf3940dae75eb8767b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen-string-literal: true

using Plum::BinaryString
module Plum
  class Frame::WindowUpdate < Frame
    register_subclass 0x08

    # Creates a WINDOW_UPDATE frame.
    # @param stream_id [Integer] the stream ID or 0.
    # @param wsi [Integer] the amount to increase
    def initialize(stream_id, wsi)
      payload = "".b.push_uint32(wsi)
      initialize_base(type: :window_update, stream_id: stream_id, payload: payload)
    end
  end
end