Class: PahoMqtt::Packet::Disconnect

Inherits:
PahoMqtt::Packet show all
Defined in:
lib/paho.mqtt/packet_manager.rb

Overview

Class representing an MQTT Client Disconnect packet

Constant Summary

Constants inherited from PahoMqtt::Packet

ATTR_DEFAULTS

Instance Attribute Summary

Attributes inherited from PahoMqtt::Packet

#body_length, #flags, #id, #version

Instance Method Summary collapse

Methods inherited from PahoMqtt::Packet

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



1021
1022
1023
# File 'lib/paho.mqtt/packet_manager.rb', line 1021

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

Instance Method Details

#parse_body(buffer) ⇒ Object

Check the body



1026
1027
1028
1029
1030
1031
# File 'lib/paho.mqtt/packet_manager.rb', line 1026

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