Network Programming (5) IO Multiplexing — epoll

1. Concept The full name of epoll is eventpoll, a notification mechanism based on event triggering. When the file descriptor read buffer is not empty, the read event is triggered. When the file descriptor write buffer is writable, the write event is triggered. 2. Principle The core data structure of epoll is: a red-black tree […]

[IO multiplexing] How EPOLL implements ET (edge trigger)

LT and ET edge-triggered What is edge triggering How to implement edge triggering Summary & Notes How to use recv & send for edge triggering recv return value of recv send level-trggered horizontal trigger code When we are doing epoll network programming, we can choose LT (horizontal trigger) or ET (edge trigger). By default, epoll […]

Network IO and IO multiplexing (select/poll/epoll) (1)

Tip: After the article is written, the table of contents can be automatically generated. For how to generate it, please refer to the help document on the right. Network IO and IO multiplexing (select/poll/epoll) (1) Preface 1. Network card 2. Network IO 1.Code Replenish 2. Use tcp/udp net assistant tool 3. Implement communication between the […]

TCP IP network programming (7) Understand the use of select and epoll

Article directory Understand the select function Function and calling sequence of select function Set file descriptor Set monitoring range and timeout select function call example Better than select’s epoll Select-based I/O multiplexing is slow Necessary functions and structures when implementing epoll epoll_create epoll_ctl epoll_wait Server side based on epoll Edge triggering and level triggering Understanding […]

io multiplexing select, poll, epoll model

1. Select model 1. Meaning of function parameters int select(int maxfd,fd_set *rset,fd_set *wset,fd_set *eset,struct timeval *timeout); Copy the fd_set set (parameters 2, 3, and 4) that need to be detected to the kernel. If there is io ready, clear the fd_set set, reset the fd_set set, and then copy it to the user layer. Parameter […]

Multi-channel IO-POll function, epoll server development process

Introduction “In computer network programming, multi-channel IO technology is a very common technology. Among them, the Poll function and the Epoll function are the two most commonly used multi-channel IO technologies. These two technologies can help the server handle the processing of multiple clients. Concurrent requests improve server performance. This article will introduce the use […]

muduo source code analysis of poller/EpollPoller multiplexing class

Introduction Poller is an abstract virtual base class of the I/O multiplexing interface, which encapsulates the I/O multiplexing API. Muduo provides EPollPoller and PollPoller derived classes (epoll and poll), so select is not supported. newDefaultPoller() selects epoll by default Main interface poll It is the core function of Poller. Use poll or epoll_wait of derived […]

Network programming: event model understanding of epoll edge triggering and horizontal triggering

Article directory There are two models for EPOLL events: ET mode LT mode Operational differences Practical uses of edge triggering code show as below EPOLL events have two models: Edge Triggered (ET) Edge trigger is triggered only when data arrives, regardless of whether there is still data in the buffer. Level Triggered (LT) Level trigger […]

23 | Linux Tool: The past and present life of epoll

The first three lectures on performance, non-blocking I/O and I/O multiplexing, have gradually helped us build an initial foundation in the field of high-performance network programming. However, we are still a little short of the final goal. If I/O multiplexing has helped us open the window for high-performance network programming, then today’s topic – epoll, […]