aboutsummaryrefslogtreecommitdiffstats
path: root/lib/plum/frame/window_update.rb
blob: 6e36b2c84fff5ed82a1942d94a9b502ab566201c (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 = String.new.push_uint32(wsi)
      initialize_base(type: :window_update, stream_id: stream_id, payload: payload)
    end
  end
end