Beispiel #1
0
void TestLset( void )
{
	try
	{
		CRedisClient redis;
		redis.connect("127.0.0.1", 6379);
        string mykey = "testList";

        redis.lset(mykey, 10, "haha");
	} catch( RdException& e )
	{
		std::cout << "Redis exception:" << e.what() << std::endl;
	} catch( Poco::Exception& e )
	{
		std::cout << "Poco_exception:" << e.what() << std::endl;
	}
}
void TestLset( void )
{
	try
	{
		CRedisClient redis;
		redis.connect("127.0.0.1", 6379);
		string mykey = "key";

		uint64_t index = 1;
		bool flag = redis.lset(mykey, index, "haha");
		std::cout << flag << std::endl;
	} catch( RdException& e )
	{
		std::cout << "Redis exception:" << e.what() << std::endl;
	} catch( Poco::Exception& e )
	{
		std::cout << "Poco_exception:" << e.what() << std::endl;
	}
}