Learning Redis source code [network communication framework]

Source: Internet
Author: User
Introduction

The first two articles mainly introduce the epoll and socket encapsulation of redis. This article will introduce in detail the specific implementation of redis network communication. Simply put, redis's network communication mainly implements the main process and implementation of server listening client connection and processing.

Source code

Networking. c

Analysis

Network Communication Process


Description

The main principle of redis network communication is similar to the general asynchronous network programming framework. It uses the socket on the server to listen to the incoming connection, create the socket corresponding to the connection, and then read and listen to the socket, after that, the event loop processor will listen to specific read events, parse and obtain the returned data, and then listen to the corresponding write events. When the socket is writable, reply will be returned to the client.

Remarks

The network framework is lightweight. In this lightweight network framework, redis will describe the Connection Client's parsing and subsequent processing in the following articles.

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.