Exemplo n.º 1
0
		public override void Execute(MemcachedSocket memcachedSocket)
		{
			memcachedSocket.WriteLine("flush_all");
			memcachedSocket.Flush();

			CheckResponse(memcachedSocket.ReadLine(), "OK");
		}
Exemplo n.º 2
0
		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");
		}
Exemplo n.º 3
0
		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));
		}
Exemplo n.º 4
0
		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);
		}
Exemplo n.º 5
0
		public void BeforeFlush(MemcachedSocket memcachedSocket)
		{
			memcachedSocket.WriteLine("get " + this.Key.Hash);
		}
Exemplo n.º 6
0
		public void BeforeFlush(MemcachedSocket memcachedSocket)
		{
			memcachedSocket.WriteLine("set " + this.Key.Hash + " 0 0 0");
			memcachedSocket.WriteLine("");
			memcachedSocket.WriteLine("delete " + this.Key.Hash + " 1");
		}