??????redis???????????????
???????????? ???????[ 2014/1/15 14:48:54 ] ??????????????? ???????
????redis????????????????????????key-value??????????????????÷??????????????????????????y???????????????????м??????
????1.?????????
?????????redis?????????μ????????http://www.redis.io/
????????????make??ɡ?
????2.redis?????????
????????????????????redis????????src????????redis-server????????????????????????redis????????????????????????????????д?????????????????????????????
daemonize yes
pidfile /tmp/redis/var/redis.pid
port 6379
timeout 300
loglevel debug
logfile /tmp/redis/var/redis.log
databases 16
save 900 1
save 300 10
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir /tmp/redis/var/
appendonly no
appendfsync always
#glueoutputbuf yes
#shareobjects no
#shareobjectspoolsize 1024
???????????redis.conf
??????????????./redis-server redis.conf???????redis???????????????????
????3.C/C++????redis
??????redis????????????deps?????????????hiredis????redis?????????????????????libhiredis.a?????????hiredis.h ?? libhiredis.a???????redis??????崠?????£?
????1?????????redisContext
????2)???redisContext???????
????3???????redisReply?л??????????
???????????£?
<pre code_snippet_id="151033" snippet_file_name="blog_20140110_2_9509153" name="code" class="cpp">redisContext * c = redisConnect((char *)"192.168.150.135"??6379);
const char * pData = "this is a test";
<pre code_snippet_id="151033" snippet_file_name="blog_20140110_2_9509153" name="code" class="cpp">redisReply *reply1 = (redisReply *)redisCommand(c??"SET 100 %s"??pData);
<pre code_snippet_id="151033" snippet_file_name="blog_20140110_2_9509153" name="code" class="cpp"><pre code_snippet_id="151033" snippet_file_name="blog_20140110_2_9509153" name="code" class="cpp"><pre code_snippet_id="151033" snippet_file_name="blog_20140110_2_9509153" name="code" class="cpp">freeReplyObject(reply1);</pre>
<pre></pre>
<pre></pre>
<pre></pre>
<pre></pre>
<pre></pre>
<p></p>
<pre></pre>
<pre></pre>
<br>
<pre code_snippet_id="151033" snippet_file_name="blog_20140110_3_730653" name="code" class="cpp"><pre code_snippet_id="151033" snippet_file_name="blog_20140110_3_730653" name="code" class="cpp"><pre code_snippet_id="151033" snippet_file_name="blog_20140110_3_730653" name="code" class="cpp">redisReply *reply2 = (redisReply *)redisCommand(c??"GET 100");</pre>
<pre></pre>
<pre></pre>
printf("%s
"??reply2->str);<br>
freeReplyObject(reply2);<br>
<pre></pre>
<pre></pre>
<pre></pre>
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11