Method: AMQ::Protocol::Connection::Tune.decode

Defined in:
lib/amq/protocol/client.rb

.decode(data) ⇒ Object

Returns:



328
329
330
331
332
333
334
335
336
337
# File 'lib/amq/protocol/client.rb', line 328

def self.decode(data)
  offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
  channel_max = data[offset, 2].unpack(PACK_UINT16).first
  offset += 2
  frame_max = data[offset, 4].unpack(PACK_UINT32).first
  offset += 4
  heartbeat = data[offset, 2].unpack(PACK_UINT16).first
  offset += 2
  self.new(channel_max, frame_max, heartbeat)
end