Class: MQTT::Packet::Pingreq
- Inherits:
-
MQTT::Packet
- Object
- MQTT::Packet
- MQTT::Packet::Pingreq
- Defined in:
- lib/mqtt/packet.rb
Overview
Class representing an MQTT Ping Request 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 = {}) ⇒ Pingreq
constructor
Create a new Ping Request 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, #to_s, #type_id, #type_name, #update_attributes, #validate_flags
Constructor Details
#initialize(args = {}) ⇒ Pingreq
Create a new Ping Request packet
1021 1022 1023 |
# File 'lib/mqtt/packet.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/mqtt/packet.rb', line 1026 def parse_body(buffer) super(buffer) unless buffer.empty? raise ProtocolException.new("Extra bytes at end of Ping Request packet") end end |