Redis Tutorial (15): C Language Connection operation code instance _redis

Source: Internet
Author: User
Tags assert redis strlen redis server redis tutorial

In the previous blog has been very detailed introduction of the Redis of the various operation commands, operating mechanism and server initialization parameters configuration. This blog is the last of the series, where you will give a code example that accesses and operates a Redis server based on the Redis client component. It should be explained, however, that the following example can only run on the Linux/unix platform because the Redis does not provide a Windows platform client based on the C interface. But for developers who use other programming languages, such as C # and Java,redis, they provide client-side components for these languages, which, in turn, can be used for various interactions between windows-based platforms and Redis servers.

The client used in this blog comes from the Redis official website and is the Redis recommended client component based on C interface, see the following link:
Https://github.com/antirez/hiredis
In the following code example, two of the most commonly used REDIS command operations are given, both in normal invocation and based on the way the pipeline is invoked.

Note: Please note the comments when reading the code.

#include <stdio.h> #include <stdlib.h> #include <stddef.h> #include <stdarg.h> #include <
  string.h> #include <assert.h> #include  

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.