Class: MQTT::Packet::Disconnect
- Inherits:
-
MQTT::Packet
- Object
- MQTT::Packet
- MQTT::Packet::Disconnect
- Defined in:
- lib/mqtt/packet.rb
Overview
Class representing an MQTT Client Disconnect packet
Constant Summary
Constants inherited from MQTT::Packet
Instance Attribute Summary
Attributes inherited from MQTT::Packet
#body_length, #flags, #id, #version
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Disconnect
constructor
Create a new Client Disconnect packet.
-
#parse_body(buffer) ⇒ Object
Check the body.
Methods inherited from MQTT::Packet
create_from_header, #encode_body, #inspect, #message_id, #message_id=, parse, parse_header, read, read_byte, #to_s, #type_id, #type_name, #update_attributes, #validate_flags
Constructor Details
#initialize(args = {}) ⇒ Disconnect
Create a new Client Disconnect packet
1003 1004 1005 |
# File 'lib/mqtt/packet.rb', line 1003 def initialize(args = {}) super(args) end |
Instance Method Details
#parse_body(buffer) ⇒ Object
Check the body
1008 1009 1010 1011 1012 1013 |
# File 'lib/mqtt/packet.rb', line 1008 def parse_body(buffer) super(buffer) return if buffer.empty? raise ProtocolException, 'Extra bytes at end of Disconnect packet' end |