Class: MqttRails::Packet::Disconnect

Inherits:
Base
  • Object
show all
Defined in:
lib/mqtt_rails/packet/disconnect.rb

Constant Summary

Constants inherited from Base

Base::ATTR_DEFAULTS

Instance Attribute Summary

Attributes inherited from Base

#body_length, #flags, #id, #version

Instance Method Summary collapse

Methods inherited from Base

create_from_header, #encode_body, #inspect, parse, parse_header, read, #to_s, #type_id, #type_name, #update_attributes, #validate_flags

Constructor Details

#initialize(args = {}) ⇒ Disconnect

Create a new Client Disconnect packet



24
25
26
# File 'lib/mqtt_rails/packet/disconnect.rb', line 24

def initialize(args={})
  super(args)
end

Instance Method Details

#parse_body(buffer) ⇒ Object

Check the body



29
30
31
32
33
34
35
# File 'lib/mqtt_rails/packet/disconnect.rb', line 29

def parse_body(buffer)
  super(buffer)
  unless buffer.empty?
    raise PacketFormatException.new(
            "Extra bytes at the end of Disconnect packet")
  end
end