Class: Memcached::Request

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

Overview

Request 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     | Reserved                      |
  +---------------+---------------+---------------+---------------+
 8| Total body length                                             |
  +---------------+---------------+---------------+---------------+
12| Opaque                                                        |
  +---------------+---------------+---------------+---------------+
16| CAS                                                           |
  |                                                               |
  +---------------+---------------+---------------+---------------+
  Total 24 bytes

Direct Known Subclasses

Add, Delete, Get, NoOp, Set, Stats

Defined Under Namespace

Classes: Add, Delete, Get, NoOp, Set, Stats

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



178
179
180
181
# File 'lib/remcached/packet.rb', line 178

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