Class: MQTT::Packet::Pingresp

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

Overview

Class representing an MQTT Ping Response 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, read_byte, #to_s, #type_id, #type_name, #update_attributes, #validate_flags

Constructor Details

#initialize(args = {}) ⇒ Pingresp

Create a new Ping Response packet



990
991
992
# File 'lib/qubitro-mqtt/packet.rb', line 990

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

Instance Method Details

#parse_body(buffer) ⇒ Object

Check the body

Raises:



995
996
997
998
999
1000
# File 'lib/qubitro-mqtt/packet.rb', line 995

def parse_body(buffer)
  super(buffer)
  
  return if buffer.empty?
  raise ProtocolException, 'Extra bytes at end of Ping Response packet'
end