This article explains Nginx's multi‑process design, detailing how the master process handles socket binding and listening while each worker creates its own epoll instance, registers events, and processes connections through a well‑structured event loop with code examples from the source tree.
This article introduces Netty, explains Java's BIO/NIO/AIO models, compares reactor threading architectures, details Netty's internal thread and handler pipeline design, and provides a complete example of building a high‑performance HTTP server with Netty.
This article dissects Go's net package, showing how its Listen, Accept, Read and Write functions combine goroutines with epoll to deliver synchronous‑style code that avoids costly thread switches, and walks through the underlying source code and runtime mechanisms step by step.
This article explains the limitations of traditional blocking I/O, introduces Java NIO with selectors, compares the two models using a kindergarten analogy, critiques raw JDK NIO, and demonstrates how Netty simplifies and optimizes network development with concise server and client code examples while promoting a comprehensive Netty learning book.
This article introduces Python's socket module, explains core concepts such as IP, ports, and protocols, demonstrates essential socket functions, and provides complete client‑server code for a simple full‑duplex TCP chat application, enabling readers to quickly start network programming in Python.
Explore the comprehensive step-by-step process of Netty server startup, covering channel creation, initialization, reactor registration, and binding, while demystifying the asynchronous flow and internal mechanisms that power high-performance network applications.
This article explains how to use Python's socket module together with I/O multiplexing techniques such as select, poll, epoll, and the high‑level selectors module to build non‑blocking, scalable network servers that can handle multiple client connections concurrently.
This article provides a comprehensive overview of Java NIO network programming, explaining BIO, NIO, and AIO models, the core components Channel, Buffer, and Selector, and how Netty leverages the Reactor pattern with multi‑threaded boss and worker groups for high‑performance asynchronous I/O.
This article explains Redis's high‑performance I/O architecture by tracing the evolution from blocking, non‑blocking, and multiplexed network models to various Reactor‑based thread designs, illustrating each model with Java pseudo‑code and diagrams to clarify why Redis adopts a single‑threaded Reactor with optional multi‑threaded I/O extensions.
The article thoroughly examines Redis’s high‑performance architecture, detailing the evolution from blocking to non‑blocking I/O, the Reactor pattern’s single‑ and multi‑reactor models, Redis’s I/O multiplexing thread design, and how its hybrid single‑thread core with auxiliary I/O threads mitigates bottlenecks under heavy traffic.
This article explains the four main I/O models—blocking, non‑blocking, multiplexed (event‑driven) and asynchronous—detailing their mechanisms, kernel interactions, performance implications, and how they differ in handling data readiness for network programming.
This article explains how Netty abstracts Java NIO's event registration by using SelectionKey interestOps, detailing the registration of OP_ACCEPT and OP_READ events, the underlying doRegister and doBeginRead implementations, and the flow of events through the Netty pipeline with illustrative code snippets.
This guide explains how WebSockets enable full‑duplex communication over a single TCP connection, compares popular Go WebSocket libraries, and provides complete client‑server code examples for TCP, UDP, and HTTP‑based WebSocket implementations, helping developers build real‑time applications such as chat, games, and monitoring tools.
This article walks through converting a Go‑based TCP private‑protocol server to support WebSocket on the same port, covering library selection, client and server implementation, request upgrading, and a complete usage example with code snippets.
This article explains the hierarchical design of network libraries, detailing the roles of Session, Connection, Channel, and Socket layers, their interactions, code examples, and how they can be combined or extended for various backend services.
This tutorial shows how to use Python's Scapy library to craft and send ARP requests for network discovery, perform ARP spoofing attacks, and implement TCP SYN port scanning by interpreting packet flags, providing complete code examples and practical security insights.
This article explains the basic network programming pattern, introduces epoll as an I/O multiplexing solution for high‑concurrency servers, and demonstrates how Redis 5.0 integrates epoll through its event‑loop abstraction with detailed code examples and debugging tips.
This article explains Netty's role as a mature I/O framework, outlines the end‑to‑end remote‑call workflow of a distributed service, details protocol design, shares performance‑tuning tricks, and presents best practices for building scalable, low‑latency backend systems.
This article walks through Redis's startup sequence, explaining how the server creates a listening socket, registers events with the aeFileEvent system, runs a single‑threaded select‑based event loop, and processes client commands using the Reactor pattern, complete with code examples and diagrams.
This article outlines the fundamental and specialized technical skills required for developing middleware in general and database middleware in particular, covering multithreading, network programming, design patterns, asynchronous programming, algorithms, testing, performance tuning, as well as SQL, transaction handling, protocol implementation, and replication.
This article explains why HttpDNS is used to improve DNS resolution for a WinInet‑based installer, compares two implementation schemes, and details a Windows API Hook solution—including inline hook techniques, detours usage, and custom GetAddrInfoEx handling—to achieve transparent, secure domain resolution on Windows clients.
This article explains how Netty, an asynchronous event‑driven network framework built on Java NIO, simplifies the creation of high‑performance, scalable web servers and client components by handling I/O streams, connection management, threading, zero‑copy transfers, and offering flexible reactor thread models for various application scenarios.
The article thoroughly examines Tars’s Java RPC client, explaining its initialization, proxy generation via JDK dynamic proxies, diverse load‑balancing strategies, NIO‑based Reactor networking, and both synchronous (CountDownLatch) and asynchronous callback mechanisms, supplemented with detailed source‑code illustrations of each component.
This article explains server thread models—including traditional blocking I/O, the Reactor pattern with its single‑thread, multi‑thread, and master‑slave variants, and the asynchronous Proactor model—detailing their mechanisms, advantages, disadvantages, and typical use cases in backend development.
This tutorial explains how to use PHP's raw socket functions to construct and send an ICMP echo request packet, calculate its checksum, receive the reply, and wrap the logic into a reusable ping($host, $retry) function for backend network diagnostics.
This article provides a deep, step‑by‑step analysis of Linux's epoll mechanism, covering socket creation with accept, the internal structures of eventpoll, how epoll_ctl registers sockets, the wait‑queue interactions, and the exact code paths that move a TCP packet from the NIC to a user‑space process.
The article explains how Vivo’s platform implements a fault‑tolerant HTTP Range (breakpoint) download in Java—detecting server support, choosing single‑or multi‑threaded segmented downloads, using RandomAccessFile and retry logic, verifying integrity with ETag/MD5, and issuing alerts, while noting when the added complexity is justified.
This article explains why synchronous blocking network I/O (BIO) is a performance bottleneck in high‑concurrency Linux servers, detailing the kernel‑level steps of socket creation, the recv path, soft‑interrupt handling, and how processes are blocked and later awakened.
This article explains why TCP suffers from sticky and unpacked packets, illustrates typical scenarios, outlines four common framing techniques, and shows how Netty's built‑in decoders can be used to reliably solve these issues in high‑performance network applications.
This article presents a seven‑day experiment measuring how much memory a TCP connection occupies in the kernel under various states such as ESTABLISH, data transfer, and TIME_WAIT, and summarizes the kernel's memory‑optimisation techniques for sockets.
This article explains the fundamentals of IO events and multiplexing, compares thread‑based and event‑driven architectures, details the Reactor pattern variants, and clarifies synchronous versus asynchronous IO, providing a practical guide for building high‑performance network frameworks in Linux environments.
This article provides a concise, code‑driven walkthrough of Netty's core components—including event‑loop groups, channel initialization, pipeline handling, and the server‑client handshake process—by simplifying the original source to highlight the essential mechanisms behind asynchronous network communication in Java.
This article explains socket fundamentals and walks through creating a simple UDP‑based chatroom in Python, covering basic socket creation, common methods, a straightforward server‑client example, and an enhanced multi‑user implementation with full source code and execution details.
This article explains the core concepts of high‑performance Linux network programming, covering IO events, IO multiplexing, thread and event‑driven architectures, the Reactor pattern and its variants, as well as synchronous versus asynchronous IO, providing clear examples and practical guidance for building efficient server frameworks.
This article explains why TCP experiences sticky and half packets, analyzes the underlying causes such as buffer size mismatches and MTU limits, and presents practical solutions including short connections, fixed‑length framing, delimiter‑based framing, and length‑field framing, with their advantages and trade‑offs.
This article explains how to build a real‑time network chatroom in Java using TCP sockets, multithreading, and a ConcurrentHashMap to manage user connections, detailing command handling for listing users, group chat, private messages, exiting, and server shutdown, with full source code examples.
This guide explains IO events and multiplexing, compares thread‑based and event‑driven models, details the Reactor pattern variants, and clarifies synchronous vs asynchronous IO, providing a practical roadmap for building high‑performance Linux network frameworks.
This article compares Linux's select, poll, and epoll mechanisms, explaining their internal workings, limitations such as FD_SETSIZE and linear scanning, and why epoll's event‑driven design offers superior scalability and performance for high‑concurrency network servers.
This article explains the fundamentals of blocking and non‑blocking I/O, compares select, poll, and epoll mechanisms, introduces the Reactor model and its variants, and shows how to solve the C10K problem with processes, threads, thread pools, and event‑driven architectures, complete with code examples.
This article explains how to use Java's java.net.Socket and ServerSocket classes to create a server and client that exchange string messages, detailing the blocking behavior of accept() and read(), and providing complete code examples for sending and receiving data in both directions.
This article provides an in‑depth tutorial on Java NIO, covering its fundamentals, IO models (BIO, NIO, AIO), core components such as Channel, Buffer and Selector, detailed code examples for a server and client, and a summary of best practices and limitations.
This article explains Netty as an asynchronous event‑driven network framework, compares synchronous and asynchronous processing, describes event‑driven programming, details the differences among BIO, NIO and AIO I/O models, and outlines Netty's core components and architecture.
This article explains the PHP pfsockopen() function, its parameters, return values, and provides a complete example demonstrating how to establish a persistent SSL socket, send an HTTP POST request, and read the response using low‑level socket operations.
fsockopen() opens a network or Unix socket connection in PHP, with detailed parameter explanations, default behavior, error handling, and two practical code examples demonstrating HTTP GET requests and UDP socket usage, along with notes on blocking mode and related functions.
This article compares the three I/O multiplexing mechanisms—select, poll, and epoll—by analyzing their time complexities, limitations, trigger modes, performance characteristics, and implementation details, helping developers choose the most suitable method for different Linux networking scenarios.
This article provides a step‑by‑step Netty tutorial for Java beginners, covering framework basics, installation of JDK, Maven and IDEA, core Netty components, differences between BIO/NIO/AIO, practical usage scenarios, and complete client‑server code to transmit a simple string.
Using iQiyi’s open‑source libfiber as a case study, the article explains how network coroutines combine sequential programming simplicity with non‑blocking I/O scalability, detailing libfiber’s single‑threaded scheduler, cross‑platform event engine, coroutine‑aware synchronization, API hooking, and its deployment in high‑performance CDN caching and DNS services.
This article explains how to read data from an io.Reader in Go, covering the basic Read method, using io.Copy with custom writers, leveraging strings.Builder and ioutil.ReadAll, and introduces additional utilities like io.ReadAtLeast and io.ReadFull for efficient data handling.
Netty, a Java‑based asynchronous event‑driven framework created in 2008, offers a unified API for multiple transports, a powerful reactor thread model, built‑in codecs, extensive protocol support, high throughput, low latency, robust error handling, and a vibrant ecosystem adopted by major tech companies and open‑source projects.
This article examines the theoretical and practical limits of concurrent TCP connections on a single Linux server, covering the historic C10K problem, file‑descriptor and port constraints, the 4‑tuple identification, and real‑world factors such as memory and bandwidth that cap achievable connections.
This article provides a comprehensive walkthrough of Netty’s core components—including ServerBootstrap, EventLoop, Channel, ChannelFuture, ChannelHandler, and ByteBuf—illustrated with a simple server example, code snippets, diagrams, and detailed explanations of threading, zero‑copy, and pipeline processing.
This article describes a Python project that implements a socket‑based file and folder transfer system using separate command and data threads, explains its design principles, provides the core FileFinder code, and shows how to run the server and client on Linux hosts.
This article walks through creating a lightweight TCP port scanner in Go, covering basic TCP handshake theory, single‑port testing, looping over ports, adding concurrency with WaitGroup, implementing timeouts, using the flag package for command‑line options, and handling race conditions with a mutex.
This tutorial walks you through creating a simulated QQ chat program in Python3, covering both client and server implementations, providing complete example code and useful resource links to help you quickly grasp network programming concepts.
Over three years, Meitu’s long‑connection service “bifrost,” built in Go with MQTT, cut memory use from 22.3 GB to 5.1 GB for 210 k connections—and about 10 GB for a million—by tuning buffers, reducing allocations, employing memory pools, and replacing a goroutine‑per‑connection model with an epoll‑driven event architecture.
This article walks through building a simple RPC framework in Go using about 300 lines of code, covering RPC fundamentals, TLV network data format, serialization, transport layer, server and client implementations, and a complete example to help readers understand RPC concepts.
This article walks through creating a lightweight RPC framework in Go, covering the definition of RPC, TLV data encoding, gob serialization, transport handling, server and client implementation, and a complete test example to illustrate core remote‑call concepts.
This article explains common TCP pitfalls such as sticky packets, how to handle them with proper framing, the importance of heartbeat mechanisms for detecting broken connections, and reliable data validation techniques like length prefixes and MD5 checksums to build robust network applications.
This article explains why the author created a custom C++ TCP server framework, outlines the required prerequisites and coding standards, and walks through a minimal echo server implementation together with the key cppbox library interfaces and usage examples.
This article explains how servers manage connections using different I/O and thread models—including traditional blocking I/O, the Reactor pattern with its single‑thread, multi‑thread, and master‑slave variants, and the Proactor model—highlighting their advantages, drawbacks, and typical use cases in backend development.
This article provides a comprehensive overview of Swoole, covering its basic concepts, TCP server implementation, base and process modes, inter‑process communication mechanisms, reactor‑worker interaction, and debugging techniques for building high‑performance PHP network services.
YouZan’s Mobile Assistant combines Android VpnService (or iOS NetworkExtension) with the open‑source ZanProxy, using tun2socks‑based SOCKS5 tunneling, UUID‑based user isolation, and an ACL‑driven fake‑DNS scheme to replace complex Charles/hosts setups with a single‑click, certificate‑only, PC‑free environment‑switching solution supporting TCP, UDP, and WebSocket traffic.
This article introduces the "Big Data Path to God" series, lists several Java advanced topics, and provides a comprehensive Netty guide covering BIO/NIO/AIO differences, Netty features, threading model, TCP packet handling, serialization choices, zero‑copy, performance aspects, and key source‑code components.
This tutorial shows how to quickly set up a functional FTP server using just nine lines of Python code with the pyftpdlib library, covering installation, core script, execution, and troubleshooting common IP address issues.
This article provides a comprehensive overview of high‑performance server I/O models—including blocking, non‑blocking, multiplexing, signal‑driven, and asynchronous I/O—explaining their principles, advantages, disadvantages, and typical usage scenarios for designing scalable backend services in production.
This article demystifies socket communication by illustrating the end‑to‑end process of TCP/UDP message exchange, detailing how client and server serialize objects, interact with kernel read/write buffers, handle blocking, acknowledgments, packet headers, and flow control, and why understanding these low‑level mechanisms is crucial for reliable network programming.
The article demystifies high‑concurrency myths by explaining that network cards merely forward packets, while the true challenges lie in OS‑level I/O handling, CPU‑IO imbalance, and selecting the right I/O models and concurrency patterns to fully utilize hardware resources.
This article explains the fundamentals of high‑concurrency systems, covering how network cards and routers handle massive traffic, the role of the operating system and epoll/select, various I/O models, reactor and multithreading patterns, and strategies to improve CPU and I/O utilization.
This article describes the motivation, requirements, solution research, and detailed design of a lightweight distributed VPN built with Go, employing KCP as the transport protocol, and includes prototype source code for both hub and peer components.
This tutorial shows how to quickly create a functional FTP server using only nine lines of Python code with pyftpdlib, covering installation, essential configuration of users and permissions, server startup, and testing via an FTP client.
This article provides a comprehensive guide to Java network programming, covering TCP/IP basics, socket concepts, InetAddress and URL APIs, detailed TCP and UDP client‑server implementations, multithreaded server handling, and practical code examples for building robust network applications.
This article introduces Netty, an asynchronous event‑driven network framework, covering its design goals, performance benefits, core components such as zero‑copy and unified APIs, advanced features like SSL/TLS and WebSocket support, and explains its single‑thread, multi‑thread, and master‑slave thread models for high‑concurrency backend development.
This article explains the thundering herd phenomenon in Linux network programming, demonstrates how to reproduce it with multi‑process accept and epoll examples, analyzes why modern kernels often suppress it, and discusses mitigation techniques such as mutex locking in Nginx.
A poetic tale follows a programmer’s evolution from using shared memory for secret messages to mastering sockets, TCP handshakes, firewalls, and HTTP‑based web services, illustrating core networking concepts through a heartfelt metaphor.
This article explains the fundamentals of Java socket programming, covering what sockets are, the three essential components for establishing a connection, sample server and client code, connection monitoring techniques, multithreaded handling of multiple clients, and UDP communication with practical considerations.
The article outlines the core components of Netty—Bootstrap/ServerBootstrap, EventLoop, EventLoopGroup, ChannelPipeline, Channel, Future/ChannelFuture, ChannelInitializer, and ChannelHandler (Inbound and Outbound)—explaining their roles in configuring, handling I/O, and processing data within a non‑blocking, event‑driven network application.
This tutorial explains why mastering low‑level socket programming is valuable, introduces TCP/IP fundamentals, walks through creating a TCP socket server in Python, shows how to implement a simple HTTP server, and suggests ways to extend the server with multithreading and additional features.
This article explains the internal workflow of Netty when launching a server, covering why Netty is chosen over raw JDK NIO, the key components created during bootstrap, the step‑by‑step source‑code analysis of channel creation, initialization, registration, and the final bind operation that activates the server.
This article introduces Linux’s epoll mechanism, explains how to create and control epoll instances with epoll_create, epoll_ctl, and epoll_wait, describes the associated data structures and event flags, compares epoll to select, and highlights its O(1) scalability advantages for high‑connection backend applications.
This article explains how to design and implement a simple game server framework, covering the definition of server development, the two main game‑server architectures, core scene‑service requirements, a lightweight network library built on sockets, and sample C# code for connectors, server and client networking components.
This tutorial explains how to use Linux raw sockets (PF_PACKET) to send and receive link‑layer Ethernet frames, covering socket creation, protocol selection, sockaddr_ll structure, interface binding, promiscuous mode, and provides a complete C example that prints MAC and IP information for each captured packet.
This guide introduces Python’s socket module, explains socket families and types, details essential server and client functions, walks through step‑by‑step TCP connection creation, and provides complete server and client code examples for practical network programming.
This article explains how to determine whether a client device supports IPv4‑only, IPv6‑only, or dual‑stack networking on iOS and Android, covering gateway detection, DNS analysis, socket‑connect tests, and practical code samples for reliable IP‑stack identification.
This article walks you through the philosophy of rebuilding software systems, explains what a network server is, and provides a detailed, hands‑on tutorial for creating a minimal Python web server, covering URLs, sockets, HTTP requests, and responses.
This article explains the differences between long and short TCP/IP connections, outlines three major communication models (server/client, connection type, and send/receive mode), describes synchronous and asynchronous transmission, and reviews various message formats and read/write strategies to help developers design robust network programs.
This article demonstrates how to build a minimal TCP server on Unix by configuring inetd or xinetd to redirect socket traffic to a shell script that reads from standard input and writes to standard output, illustrating core networking and scripting concepts.
This article explains the four theoretical I/O models—blocking, non‑blocking, synchronous, and asynchronous—and details five practical network service I/O patterns, illustrating each with diagrams and showing how they can be implemented using libraries such as libevent.
This article examines various network server architectures—from blocking sockets and multithreaded designs to select‑based and libev‑driven event loops—highlighting their trade‑offs, performance implications, and practical implementation details for building efficient high‑concurrency services.