public override void Clear() { var api = new ApiPacket(10, 4); api.Set("sessionid", Id); var response = TcpFrame.Send(api); IsSuccess(response); }
public override void Remove(string key) { var api = new ApiPacket(10, 3); api.Set("sessionid", Id); api.Set("key", key); var response = TcpFrame.Send(api); IsSuccess(response); }
public override void Set(string key, byte[] value) { var api = new ApiPacket(10, 2); api.Set("sessionid", Id); api.Set("key", key); api.Bytes = value; var response = TcpFrame.Send(api); IsSuccess(response); }
public override IEnumerable <string> GetKeys() { var api = new ApiPacket(10, 0); api.Set("sessionid", Id); var response = TcpFrame.Send(api); IsSuccess(response); var _keys = response.Obj == null?Array.Empty <string>() : response.Obj.Split('|').AsEnumerable(); return(_keys); }
public override bool TryGetValue(string key, out byte[] value) { var api = new ApiPacket(10, 1); api.Set("sessionid", Id); api.Set("key", key); var response = TcpFrame.Send(api); IsSuccess(response); value = response.Bytes; return(value != null); }