---
title: "Discussion on \"使用epoll()进行socket编程处理多客户连接的TCP服务器实例\" | Hashnode"
description: "Discussion on \"使用epoll()进行socket编程处理多客户连接的TCP服务器实例\". 在网络编程中，当需要使用单线程处理多客户端的连接时，常使用select()或者poll()来处理，但是当并发数量非常大时，select()和poll()的性能并不好，epoll()的性能大大好于select()和poll()，在编写大并发的服务器软件时，epoll()应该是首选的方案，本文介绍epoll()在网络编程中的使用方法，本文提供了一个具体的实例，并附有完整的源代码，本文实例在 ubuntu 20.04 下编译测试完成，gcc 版本号 9.4.0。\n\n1 基本概念\n\n在『网络编程专栏』中..."
url: "https://hashnode.com/posts/180024-using-epoll-in-socket-programming/6712684a95892ca2bd3d78fd"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [使用epoll()进行socket编程处理多客户连接的TCP服务器实例](https://whowin.cn/180024-using-epoll-in-socket-programming?utm_source=hashnode&utm_medium=feed)

在网络编程中，当需要使用单线程处理多客户端的连接时，常使用select()或者poll()来处理，但是当并发数量非常大时，select()和poll()的性能并不好，epoll()的性能大大好于select()和poll()，在编写大并发的服务器软件时，epoll()应该是首选的方案，本文介绍epoll()在网络编程中的使用方法，本文提供了一个具体的实例，并附有完整的源代码，本文实例在 ubuntu 20.04 下编译测试完成，gcc 版本号 9.4.0。 1 基本概念 在『网络编程专栏』中...

Mar 9, 2024 · 5 min read · whowin.cn  
Read the article

-   [#linux](https://hashnode.com/tag/linux)
-   [#572r57uc57yw56il](https://hashnode.com/tag/572r57uc57yw56il)
-   [#epoll](https://hashnode.com/tag/epoll)
-   [#socket](https://hashnode.com/tag/socket)

## Written by

[whowin](https://hashnode.com/@whowin)

@whowin · Beijing, China

  
[View profile](https://hashnode.com/@whowin)

一枚有30多年经验的退休程序员，主要从事嵌入式软件开发

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
