This article dissects the complete TCP socket lifecycle from a kernel perspective, covering socket creation, three-way handshake, connection queues, send/recv buffer behavior, sticky packet solutions, and graceful closure with code examples and troubleshooting commands.
This comic-style guide follows an HTTP request's complete journey through DNS resolution, TCP/TLS handshakes, Socket connections, Nginx reverse proxy, gRPC service calls, Redis caching, MySQL queries, and connection pools, revealing how each layer contributes to latency and why observability matters.
This article walks through the OSI model, explains TCP's three‑way handshake and four‑way teardown versus UDP, clarifies TIME_WAIT behavior and kernel tuning, compares short and long socket connections with heartbeats, and demonstrates building a custom protocol and a Node.js socket connection pool using generic‑pool.
This article walks through creating a minimal Java 17 RPC framework—from defining a simple binary protocol and using JDK serialization to implementing server loops, dynamic proxy‑based clients, and a runnable demo—while also highlighting the gaps that production‑grade solutions like Dubbo or gRPC must fill.
This article walks through the TCP protocol step by step—starting with physical and data‑link layers, then IP addressing, sockets, transport‑layer functions, TCP header fields, reliable transmission mechanisms, congestion control, connection setup and teardown, and finally a comparison with UDP—using concrete diagrams and real‑world analogies.
This article walks through the OSI model, explains TCP three‑way handshake and four‑way termination, contrasts TCP with UDP, discusses TIME_WAIT issues, describes long vs short socket connections, shows how to design a custom protocol and implements a reusable Socket connection pool in Node.js.
This article walks through TCP from the physical layer up to congestion control, explaining MAC and IP addressing, sockets and ports, reliable transmission mechanisms like stop‑and‑wait and sliding windows, the three‑way handshake, four‑way teardown, UDP differences, routing, packet fragmentation, and security considerations.
This article walks developers through the OSI model, explains TCP's three‑way handshake and four‑way termination, contrasts TCP with UDP, addresses common networking questions, and details how to implement long‑lived socket connections and a reusable socket connection pool in Node.js.
This guide walks beginners through progressive Linux network programming projects—starting with an Echo server, advancing to a concurrent chatroom, and culminating in a simple HTTP server—to solidify core concepts like TCP handshakes, socket I/O, and protocol handling.
This article explains TCP as a connection‑oriented, reliable byte‑stream transport protocol, detailing its header fields, state machine, three‑way handshake, four‑way termination, TIME_WAIT handling, Linux inspection commands, optimization techniques, and a comparison with UDP, all illustrated with concrete examples and diagrams.
This tutorial walks through the OSI model, explains TCP three‑way handshake and four‑way termination, compares TCP and UDP, addresses common TCP tuning questions, describes long versus short socket connections with heartbeats, and shows how to design a custom protocol and implement a reusable Socket connection pool in Node.js.
This article explores why Linux separates socket listening into bind and listen system calls, analyzing the design rationale, kernel internals, port allocation strategies, and connection queue behaviors through experiments and Linux 5.15 source code analysis.
This guide explains PHP’s fsockopen() function, detailing its syntax, parameters, return values, and a complete example that opens a TCP connection, sends an HTTP GET request, reads the response, and notes how to use SSL for secure connections.
This article explains how PHP's fsockopen() function works, detailing its syntax, parameters, return values, and providing a complete example that demonstrates opening a TCP connection, sending an HTTP request, and handling the response, including notes on SSL usage.
This article explains how Linux’s epoll mechanism, built on libevent and using red‑black trees and ready‑list queues, provides scalable I/O multiplexing for sockets, eventfd and timerfd while traditional file systems like ext4 cannot be managed directly, and outlines the key efficiency tricks behind its design.
This article explains how Linux’s Netlink mechanism provides efficient, full‑duplex communication between kernel space and user space, overcoming the limitations of ioctl, /proc, and system calls, and details its architecture, data structures, API usage, and real‑world applications.
Port 0 is a legal but reserved value that can be used by operating systems to assign temporary ports, yet it also appears in abnormal traffic, so understanding its semantics, proper usage in code, and how firewalls and security tools treat it is essential for developers and operators.
This article walks developers through the OSI model, explains TCP three‑way handshake and four‑way termination, compares TCP and UDP, discusses socket long connections, heartbeat mechanisms, custom application‑layer protocols, and implements a Node.js socket connection pool for high‑concurrency scenarios.
This comprehensive guide walks readers through the fundamentals of computer networking, covering architecture models, TCP and UDP protocols, HTTP basics, socket programming, IP addressing, ICMP, Ping, and related concepts such as routers, cookies, and token authentication, all illustrated with clear diagrams.
This article explores the Linux kernel’s network stack architecture, detailing each layer from the application’s socket interface through transport, network, and link layers, and explains the complete inbound and outbound data flow with code examples illustrating packet reception, processing, routing, and transmission.
The article explains that the 65,535 limit refers only to available port numbers, while actual TCP concurrency on Linux depends on the 4‑tuple identification, memory, file‑descriptor limits, and port reuse, allowing servers to handle far more connections than the port count suggests.
This article explains how send and receive socket buffers work, why they are crucial for TCP flow and congestion control, how to tune kernel parameters and application settings, and what common pitfalls and testing methods help keep network services stable and efficient.
This article introduces the POSIX standard for portable multithreaded and network programming in C, explains thread creation, lifecycle, and synchronization mechanisms such as mutexes, semaphores and condition variables, and provides complete server‑client socket examples together with practical multithreaded file‑processing code and debugging tips.
Socket provides a file‑descriptor based network communication abstraction in the OS, while epoll uses a red‑black‑tree and ready‑queue mechanism to deliver O(log N) scalable I/O event handling, together forming the core design that enables high‑concurrency servers to efficiently manage thousands of connections.
This article explains Go's socket programming workflow, the versatile net.Dial function for TCP, UDP, and ICMP connections, provides complete ICMP and TCP example programs, and then covers HTTP client usage with net/http, including basic methods, form posts, and custom request handling.
This article introduces phpy, an open‑source bridge that lets PHP import and execute Python packages, and walks through its latest features such as the with‑syntax, socket handle conversion, exception propagation, slicing, enum definition, annotated functions, and environment variable handling with concrete code samples.
This article provides a comprehensive overview of Linux socket programming, covering socket definitions, classifications such as stream, datagram, and raw sockets, connection-oriented versus connectionless communication, IP/port/MAC addressing, byte order considerations, and practical C API examples for creating and using sockets.
This article provides a comprehensive guide to TCP connection states, common Linux commands for monitoring them, detailed explanations of each state transition, three‑way handshake, four‑way termination, flag meanings, keep‑alive mechanisms, and practical sysctl tuning to troubleshoot network issues.
This article explains how to use Python's socket module to craft and send raw HTTP GET, POST, and custom‑header requests, then shows how to encapsulate the logic into reusable classes that handle authentication, redirects, cookies, and HTTPS, providing a low‑level networking toolkit for developers.
This article explains why emojis become garbled when transmitted via sockets, explores Unicode encoding fundamentals—including UTF‑8, BMP and high‑code‑point characters—and provides practical solutions using codePointAt, TextEncoder, and TextDecoder to ensure correct emoji handling.
This article explains the TCP/IP four‑layer architecture, how data is encapsulated and decapsulated across layers, the operation of ARP and DNS protocols, and how sockets provide user‑space access to these networking services.
This course provides an in‑depth exploration of core backend concepts—including processes, socket programming with TCP/IP, Nginx‑FASTCGI communication, host‑to‑network byte order conversion, and Redis fundamentals—to equip developers, system administrators, and network engineers with comprehensive backend development skills.
This course offers an in‑depth exploration of process concepts, TCP/IP and Socket communication, Nginx‑FASTCGI integration, host‑to‑network byte order conversion, and Redis fundamentals, targeting backend developers, system administrators, and network engineers seeking comprehensive backend skill enhancement.
This article walks through the design and Go implementation of a reusable Redis connection pool, covering the pool data structure, object acquisition and release logic, handling of active limits and waiting queues, and an extended per‑IP socket pool for distributed Redis clusters.
This article explains the thundering herd issue caused by multiple workers waiting on the same socket event, describes how the SO_REUSEPORT socket option eliminates the wasteful wake‑ups, and shows step‑by‑step how Workerman can be configured to use reusePort for better concurrency and throughput.
Learn how to create a basic UDP chat application in Python using the built‑in socket library, covering UDP protocol basics, environment setup, server and client code, execution steps, and tips for extending the program with multithreading or error handling.
This article presents a complete Netty TCP client demo that uses a local BlockingQueue to simulate a message broker, applies Redis distributed locks to prevent duplicate connections, integrates Spring Boot 2.2.0, and provides detailed code, workflow, and testing instructions for developers.
This article explains the PHP fsockopen() function, detailing its syntax, parameters, return values, and provides a complete example that demonstrates opening a TCP connection, sending an HTTP request, handling errors, and reading the response, including notes on SSL connections.
This article details the methodology for discovering and analyzing Android local socket service vulnerabilities, outlines prerequisite skills, explains service classifications, demonstrates data‑handling function tracing, and presents a CVE‑2023‑35694 case study, highlighting common flaw types and mitigation insights.
This article explains the fundamentals of device communication, from simple LAN setups using hubs and switches to internet protocols like HTTP, then guides the design of custom communication protocols, illustrates JSON‑RPC over sockets, and explores CAN bus specifics, offering practical code examples and architectural diagrams.
This article explains the thundering herd effect, walks through Nginx's master‑worker architecture and its use of epoll, and compares three practical solutions—accept_mutex, EPOLLEXCLUSIVE, and SO_REUSEPORT—to eliminate wasted wake‑ups in high‑concurrency servers.
This article explains the fundamentals of sockets as a network communication abstraction, covering process communication, TCP/UDP protocols, socket descriptors, key system calls, the TCP three‑way handshake and four‑way termination, Linux kernel basics, and provides complete C examples for a server and client.
This article demonstrates how Spring Boot’s connectionTimeout setting influences server‑client connections, using three experiments—controller sleep, HttpURLConnection requests, and raw socket communication—to reveal that the timeout only terminates idle client connections, not the duration of request processing.
The article explains how data packets travel between chat clients, why packet loss can occur at various stages such as connection setup, flow control, NIC buffers, and end‑to‑end links, and provides Linux commands and tools like ping and mtr to diagnose and mitigate these issues.
This article explains how to replace thread‑heavy WebSocket or Socket.IO clients with a Netty‑based Java WebSocket client, covering Maven dependencies, connection setup, event‑loop management, message sending, and a custom channel handler for high‑concurrency scenarios.
This article presents a complete Netty‑based TCP demo for IoT projects, detailing the project background, architecture, module layout, business flow, and step‑by‑step code explanations—including message queue handling, client creation, Netty client implementation, handler logic, caching, and testing endpoints—providing a practical reference for building robust long‑connection services.
The article describes an eBPF‑based, language‑agnostic traffic recording framework that hooks low‑level socket operations and thread identifiers to capture complete request‑response flows across Java, PHP, and Go services without modifying application code, dramatically lowering implementation and maintenance costs for cloud‑native traffic replay.
This article explains how unstable network conditions cause TCP disconnections in video conferencing, and provides detailed guidance on TCP/IP heartbeat mechanisms, packet loss retransmission, socket keep‑alive configuration, libwebsockets integration, and non‑blocking connect timeout control with code examples.
This article explains how TCP/IP heartbeat and retransmission mechanisms work, shows how to configure Windows keep‑alive parameters, demonstrates using libwebsockets’ keep‑alive settings, and provides non‑blocking socket + select code to detect connection failures and enforce a 60‑second reconnection window for video conferencing applications.
This article explains how unstable network conditions cause TCP disconnections in video conferencing, then details TCP/IP heartbeat mechanisms, ACK handling, keepalive parameter tuning, libwebsockets integration, packet loss retransmission, and non‑blocking socket connect timeout control with code examples.
This article explains the concept of sockets using a plug analogy, details their usage in TCP/UDP communication, explores the kernel's sock structures and inheritance tricks, and describes how sockets expose network functionality to user‑space programs through file descriptors and queues.
This article explains the OSI seven‑layer model, the mechanics of TCP three‑way handshakes and four‑way teardowns, differences between TCP and UDP, long‑ versus short‑lived socket connections, custom protocol design, and how to implement a socket connection pool using Node.js.
This comprehensive guide walks you through the OSI seven‑layer model, explains TCP and UDP fundamentals, details the three‑way handshake and four‑way termination, compares long and short connections, introduces heartbeat packets, and demonstrates how to build a custom protocol and a socket connection pool in Node.js.
This article explains the OSI seven‑layer model, the principles and handshake processes of TCP and UDP, the differences between them, the concept of long‑living socket connections with heartbeats, custom application‑layer protocols, and how to implement a reusable socket connection pool in Node.js.
This article walks developers through network protocol fundamentals, explaining the OSI seven‑layer model, TCP three‑handshake and four‑teardown processes, UDP characteristics, long‑vs‑short connections, heartbeat mechanisms, custom protocol design, and a practical Node.js socket connection‑pool implementation.
This article explains the OSI seven‑layer model, the differences between TCP and UDP, the three‑way handshake and four‑step termination processes, long‑living socket connections, heartbeat mechanisms, custom application‑layer protocols, and how to implement a socket connection pool using Node.js.
This article explains how to create a Python‑based network port scanner that probes a target host, uses sockets and multithreading to detect open TCP ports, and provides clear usage instructions, sample code, and optional enhancements for faster or more comprehensive scanning.
An in‑depth tutorial demonstrates building a Netty‑based TCP client with Spring Boot, covering project architecture, module layout, message‑queue simulation, detailed Java code for client creation, connection handling, and testing endpoints, providing a complete, production‑ready demo for IoT socket communication.
This article presents a complete Netty‑based TCP demo for IoT projects, detailing the project background, architecture, module layout, business flow, and in‑depth Java code examples—including a local queue, multithreaded processing, client creation, Redis locking, and SpringBoot integration—along with testing instructions and source links.
This article explains the concepts, purposes, and inner workings of TCP keepalive and HTTP keepalive, compares their roles in maintaining network connections, and provides practical guidance on configuring related parameters and handling socket lifecycles in server environments.
This article explains the two‑stage socket I/O process in Linux, compares blocking, non‑blocking, and I/O multiplexing techniques, details the select, poll, and epoll APIs with their advantages and drawbacks, and provides complete C code examples for a high‑performance TCP server and client.
This article presents a comprehensive Netty TCP demo project, covering its architecture, module layout, business flow, detailed Java code for message queuing, client execution, handler implementation, testing endpoints, and deployment considerations, providing a practical learning resource for backend developers.
This article explains the fundamentals of network protocols, the OSI seven‑layer model, TCP three‑handshake and four‑teardown processes, differences between TCP and UDP, socket long‑connections, custom protocol design, and how to implement a reusable socket connection pool in Node.js.
The article explains that the 65,535 TCP port limit does not bound a Linux server’s concurrent connections, detailing how TCP connections are identified, the theoretical maximum of 2⁴⁸ connections for a server, and the practical constraints imposed by memory and file‑descriptor limits.
This guide introduces the high‑performance Workerman PHP socket framework, outlines its key features, provides step‑by‑step installation and start/stop commands, and demonstrates how to build and consume RPC services with both synchronous and asynchronous client calls.
This article explores Linux kernel TCP connection handling by examining socket data structures, port range and file descriptor tuning, core functions like tcp_v4_rcv, and lookup mechanisms, while offering practical tips to boost client-side concurrent connections beyond traditional limits.
This article presents Python scripts for server‑side and client‑side resource monitoring, automatically checking CPU, memory, disk usage and network traffic, storing alerts in MySQL and optionally sending notifications via email or Enterprise WeChat, with deployment instructions and cron scheduling.
This guide explains the netstat command’s purpose, interprets its output sections for active Internet connections and UNIX domain sockets, details common options such as -a, -t, -u, -l, -p, and provides numerous practical examples for listing ports, monitoring traffic, displaying routing tables, and identifying processes.
The article explains how TCP connections are identified by a four‑tuple, clarifies the theoretical maximum of 65,535 client ports versus the far larger possible server connections, and discusses practical limits imposed by memory, file descriptors, and system configuration on Linux servers.
This article explains why a server must invoke listen() after bind(), detailing the kernel's listen system call, how it creates and initializes the full‑connection and half‑connection queues, and how their lengths are calculated based on backlog, somaxconn, and tcp_max_syn_backlog parameters.
This article explains the TCP keepalive mechanism, its purpose, default parameters, how to configure and verify it on Linux, its drawbacks, and the distinction between TCP keepalive and HTTP Keep-Alive, providing practical code examples and network analysis steps.
In high‑concurrency scenarios, massive TIME_WAIT TCP connections can exhaust local ports, causing new connections to fail, but by understanding the TCP four‑handshake, adjusting socket reuse settings, and using keep‑alive, you can mitigate the issue.
This guide explains TCP connection states, essential Linux commands, three‑way handshake, four‑way termination, simultaneous open/close, flag meanings, common error codes, and keep‑alive techniques to help you troubleshoot and secure network services effectively.
This article explains the end‑to‑end journey of a data packet in a TCP‑based chat application, identifies multiple points where packet loss can occur—from connection handshake to NIC queues—and offers practical Linux commands for diagnosing and mitigating these losses.
This article builds a simple two‑VM testbed to explore how Linux socket buffer parameters affect TCP throughput, demonstrates baseline speeds, adds artificial network delay, analyzes the bandwidth‑delay product, and shows how tuning tcp_wmem, tcp_rmem and related sysctl settings can recover performance on high‑latency links.
This guide explains how to use the Linux ss command to view socket information, covering basic usage, options for filtering TCP/UDP/UNIX sockets, suppressing headers, showing listening sockets, summarizing statistics, and preventing DNS resolution, with concrete command examples and output screenshots.
This article walks developers through the fundamentals of the OSI model, TCP three‑way handshake and UDP characteristics, explains socket concepts, demonstrates Node.js server and client implementations with heartbeats and custom protocols, and details how to build and use a socket connection pool with the generic‑pool library.
This article explains the OSI seven‑layer model, the differences between TCP and UDP, the mechanics of TCP three‑way handshake and four‑step termination, how sockets work in Node.js, and how to implement custom protocols and a socket connection pool for high‑concurrency applications.
This article explains what sockets are, how they relate to TCP/IP and HTTP, introduces the origin and purpose of WebSocket, compares it with traditional sockets, and details the WebSocket handshake, data framing, and differences from HTTP for real‑time bidirectional communication.
This article explains why Linux kernels 3.9+ allow multiple processes to bind the same port, how the REUSEPORT option implements kernel‑level load balancing, and provides step‑by‑step examples showing configuration, code snippets, and performance verification.
This article explains the Linux SO_REUSEPORT feature introduced in kernel 3.9, how it allows multiple processes to bind and listen on the same port, the kernel's load‑balancing mechanism, and provides practical C examples and verification steps for developers.
Unplugging a network cable does not immediately terminate a TCP connection; the kernel’s socket state remains ESTABLISHED, and the connection’s fate depends on data transmission, retransmission limits, TCP keepalive settings, and whether either side detects a failure.
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.
The article explains how the Linux ss command provides a faster, more detailed view of TCP/UDP sockets than netstat, lists its key features, demonstrates practical examples for filtering by state, address, and port, and shows how to use various ss options for effective network diagnostics.
This article explores TCP’s connection termination process, detailing the classic four‑way handshake, scenarios that reduce it to three or two handshakes, the concept of self‑connections, simultaneous opens, and practical implications for developers, including code examples and troubleshooting tips.
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.
When a Go TCP proxy splits socket I/O into separate read and write goroutines, closing the connection can cause "use of closed network connection" errors, and this article shows how to use context cancellation and SetReadDeadline to make both loops exit cleanly.
This article explains the fundamentals of I/O, details how sockets are created, bound, listened to, and accepted, describes the client-side connect process, and clarifies why read, write, accept, and connect operations can block, laying the groundwork for deeper Netty studies.
This article explains the nature of the 127.0.0.1 loopback address, why pinging it works without a physical network connection, the differences between 127.0.0.1, localhost and 0.0.0.0, and how the kernel processes loopback traffic using a virtual network interface.
This article explains the Linux kernel's process for selecting a client-side TCP port during connect() and bind(), covering the relevant source code, random port selection algorithm, conflict checks, and common error scenarios such as "Cannot assign requested address".
This article explains the TCP three‑handshake process, the roles of the full‑connection (accept) and half‑connection (SYN) queues, how to inspect their lengths on Linux, and practical solutions for queue overflow including kernel parameters and socket options.
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 article explains the inner workings of the Linux netstat command, walks through reading /proc/net/tcp and related files, demonstrates how to map sockets to processes, and provides a complete Go implementation of a lightweight netstat utility with code examples and detailed parsing logic.
This article dives deep into the Linux kernel implementation of the listen system call, explaining how the kernel creates and initializes the full‑connection and half‑connection queues, how backlog and system parameters interact, and why these steps are essential before a server can accept client connections.
This article explores why a server must call listen() before accept() by dissecting the Linux kernel's listen system call, its interaction with socket objects, and how the kernel calculates and initializes the full and half‑connection queues based on backlog and system parameters.
This article explains the fundamentals of TLS as a transport‑layer security protocol, demonstrates how to create a TLS‑encrypted socket server and client in Go, and shows how to generate and verify certificate chains using tools like mkcert.
This article explains the purpose of the TCP TIME_WAIT state, how it prevents packet loss and connection errors, examines its duration based on the Maximum Segment Lifetime, and analyzes why high‑QPS load testing tools like ab may appear to bypass TIME_WAIT, revealing the impact on server resources.
Through a playful narrative, the article explains how Linux processes interact with the kernel, why blocking I/O is inefficient, and how the epoll system call and its associated mechanisms like soft interrupts and the scheduler dramatically improve network concurrency and performance.
This article narrates how a process interacts with sockets, the drawbacks of blocking reads, the shift to non‑blocking I/O, and the advantages of epoll’s multiplexing in Linux, illustrating the concepts with a humorous story and visual diagrams.