# File tokyotyrant.rb, line 543 def addint(key, num = 0) key = _argstr(key) num = _argnum(num) if !@sock @ecode = EINVALID return nil end sbuf = [0xC8, 0x60, key.length, num].pack("CCNN") sbuf += key if !_send(sbuf) @ecode = ESEND return nil end code = _recvcode if code == -1 @ecode = ERECV return nil end if code != 0 @ecode = EKEEP return nil end return _recvint32 end