Class: Memcached::Response

Inherits:
Packet
  • Object
show all
Defined in:
lib/remcached/packet.rb

Overview

Response header:

Byte/     0       |       1       |       2       |       3       |
   /              |               |               |               |
  |0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|
  +---------------+---------------+---------------+---------------+
 0| Magic         | Opcode        | Key Length                    |
  +---------------+---------------+---------------+---------------+
 4| Extras length | Data type     | Status                        |
  +---------------+---------------+---------------+---------------+
 8| Total body length                                             |
  +---------------+---------------+---------------+---------------+
12| Opaque                                                        |
  +---------------+---------------+---------------+---------------+
16| CAS                                                           |
  |                                                               |
  +---------------+---------------+---------------+---------------+
  Total 24 bytes

Class Method Summary collapse

Methods inherited from Packet

#[], #[]=, extra, extras, field, fields, #initialize, #parse_body, #to_s

Constructor Details

This class inherits a constructor from Memcached::Packet

Class Method Details

.parse_header(buf) ⇒ Object



280
281
282
283
# File 'lib/remcached/packet.rb', line 280

def self.parse_header(buf)
  me = super
  me[:magic] == 0x81 ? me : nil
end