public override void Execute(MemcachedSocket memcachedSocket) { memcachedSocket.WriteLine("flush_all"); memcachedSocket.Flush(); CheckResponse(memcachedSocket.ReadLine(), "OK"); }
public override void Execute(MemcachedSocket memcachedSocket) { memcachedSocket.WriteLine("stats"); string line = memcachedSocket.ReadLine(); while (line.StartsWith("STAT")) { int indexOfStatName = line.IndexOf(" ") + 1; int indexOfStatValue = line.IndexOf(" ", indexOfStatName); string name = line.Substring(indexOfStatName, indexOfStatValue - indexOfStatName); string value = line.Substring(indexOfStatValue, line.Length - indexOfStatValue); Stats.Add(new KeyValuePair<string, string>(name, value)); line = memcachedSocket.ReadLine(); } CheckResponse(line, "END"); }
public void BeforeFlush(MemcachedSocket memcachedSocket) { string command; uint absAmount; if (amount >= 0) { command = "incr"; absAmount = (uint)amount; } else { command = "decr"; absAmount = (uint)-amount; } memcachedSocket.WriteLine(String.Format("{0} {1} {2}", command, this.Key.Hash, absAmount)); }
internal void WriteCommandToStream(MemcachedSocket memcachedSocket, string command) { string firstLine = String.Format("{0} {1} {2} {3} {4}", command, this.Key.Hash, (int)this.objType, Convert.ToString(GetExpiration(expiry), CultureInfo.InvariantCulture), this.dataToBeStored.Length); memcachedSocket.WriteLine(firstLine); memcachedSocket.WriteLine(dataToBeStored); }
public void BeforeFlush(MemcachedSocket memcachedSocket) { memcachedSocket.WriteLine("get " + this.Key.Hash); }
public void BeforeFlush(MemcachedSocket memcachedSocket) { memcachedSocket.WriteLine("set " + this.Key.Hash + " 0 0 0"); memcachedSocket.WriteLine(""); memcachedSocket.WriteLine("delete " + this.Key.Hash + " 1"); }