Class: MQTT::Packet::Disconnect

Inherits:
MQTT::Packet show all
Defined in:
lib/mqtt/packet.rb

Overview

Class representing an MQTT Client Disconnect packet

Constant Summary

Constants inherited from MQTT::Packet

ATTR_DEFAULTS

Instance Attribute Summary

Attributes inherited from MQTT::Packet

#body_length, #flags, #id, #version

Instance Method Summary collapse

Methods inherited from MQTT::Packet

create_from_header, #encode_body, #inspect, #message_id, #message_id=, 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


1053
1054
1055
# File 'lib/mqtt/packet.rb', line 1053

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

Instance Method Details

#parse_body(buffer) ⇒ Object

Check the body


1058
1059
1060
1061
1062
1063
# File 'lib/mqtt/packet.rb', line 1058

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