按年被提到
20082023 · 13 次2026
开源书›系统与网络·No.21·简称 Beej

Beej's Guide to Network Programming

Beej 网络编程指南:Internet 套接字
Brian “Beej Jorgensen” Hall

用 C 讲套接字编程,易读的网络编程经典入门指南

免费阅读 ↗
被推荐 · 95 人首次 2008-04-01 · 最近 2026-01-11官方免费在线(版权保留,作者或出版社免费放出)
95不同的人
68活跃月份
38有推荐的月份
93讨论串

Brian Hall(Beej)写的网络编程指南,以 C 语言讲 Berkeley 套接字 API,覆盖 IPv4 与 IPv6、TCP 与 UDP、客户端与服务器的写法,并附有可运行的示例代码。语言口语化、好读,重点放在动手写出能工作的程序。内容偏经典,主要讲阻塞 I/O 和 select(),而不是现代的异步框架。

HN 为什么推荐它

HN 上的人长期把它当作学套接字的标准起点:写得清楚、容易读,有人自己或在课上用它入门,常说它是最好的免费编程书之一。也有人提醒它偏老派,只讲阻塞 I/O 和 select(),还有人觉得其中的服务器示例代码有些绕。

难度 3 / 5约 12 小时
适合谁

想用 C 理解套接字与网络编程的人

读之前最好知道
1C 语言指针
2基本的 Unix 命令行
3TCP/IP 基础概念

怎么读

由 Claude 根据这本书和 HN 上的说法整理,可能有错
  1. 1先快速读背景部分,再从套接字基本调用读起
  2. 2照着示例代码自己敲一遍客户端和服务器
  3. 3读完后想了解高并发,再另找 epoll 或异步 I/O 的资料
  4. 4与作者的 C 语言指南配合着读

HN 书评

推荐在前,同类按时间 · 每本最多保留 20 条,统计用全部提及 · 作者本人贴的不算
强烈推荐peter_l_downs · 2012-10

“If you want to understand sockets, there's no excuse for not reading Beej's Guide to Network Programming [1].”

说想弄懂 sockets 就没理由不读它
Python socket programming tutorial原评论 ↗
强烈推荐rubiquity · 2014-04

“My favorite free programming books are anything by Beej. His networking[0] and C[1] books are simply phenomenal.”

称 Beej 的免费书是自己最爱,网络和 C 两本都极好
Free Programming Books原评论 ↗
强烈推荐dprophecyguy · 2018-03

“This is by far the best networking book I have read.”

称它是读过最好的网络书
Ask HN: A crash course in networking原评论 ↗
推荐brentr · 2008-04

“Have you tried understanding the Berkeley Sockets API with C? There are some good sites that cover basics: Beej's Guide to Network Programming”

向想理解 Berkeley Sockets API 的人推荐,讲 C 下的基础
Getting Started with Programming using the Internet原评论 ↗
推荐tsuraan · 2009-05

“just in case anybody hasn't seen it, beej's guide to networking is pretty nice. Beej's Guide to Network Programming”

提醒大家 Beej 的网络编程指南很不错
Socket Programming Basics Presentation Tutorial原评论 ↗
推荐stonemetal · 2011-07

“This is probably a little too entry level but it makes a good reference.”

说它偏入门,但适合当参考
Ask HN: Resources for multiplayer game server development原评论 ↗
看全部 20 条 →
推荐p1mrx · 2013-04

“Beej's Guide shows how to use the C socket APIs in a dual-stack manner:”

拿它说明如何以 dual-stack 方式使用 C socket API
A Primer on IPv4, IPv6 and Transition原评论 ↗
推荐derefr · 2013-08

“Oh, and start here, if anywhere: Beej's Guide to Network Programming”

建议从它开始了解互联网如何运作
Nanomsg – MIT-licensed ZeroMQ alternative原评论 ↗
推荐angersock · 2013-11

“Learn about networking with sockets: Beej's Guide to Network Programming”

推荐用它学 socket 网络编程
Ask HN: Help a self taught programmer wannabe what to do next原评论 ↗
推荐marai2 · 2014-03

“This is a very readable online book on networking and sockets:”

称它是讲网络和 sockets 的很易读的在线书
Understanding IP, TCP, and HTTP原评论 ↗
推荐eshyong · 2014-04

“People recommend Beej's tutorials, which are quite comprehensive and a good source of information, but I found some of his server code confusing and convoluted”

承认它全面,但觉得其中的服务器代码混乱难懂
Low-level is easy原评论 ↗
推荐mahmud · 2014-06

“Read Beej's C and network programming guides. Get a Free UNIX, download the source for simple utilities and tinker.”

建议读 Beej 的 C 和网络编程指南,再动手改源码
The Secret Guild of Silicon Valley (2012)原评论 ↗
推荐fapjacks · 2017-03

“There's always the classic Beej's Guide to Network Programming [0], which is pretty low-level but something I always point to when mentoring.”

称它是偏底层的经典,指导新人时总推荐
Ostinato – A Network Traffic Generator and Analyzer原评论 ↗
推荐yorwba · 2017-09

“Beej's Guide to Network programming is also pretty good. It was effectively used as the textbook in my networking class.”

推荐它,说它在自己的网络课上被当作教材
Beej's Guide to C Programming (2007)原评论 ↗
推荐TorKlingberg · 2017-09

“It's definitely worth reading, but be aware that it's quite old-fashioned in that it focuses entirely on blocking I/O and select().”

值得读,但提醒它较老派,只讲 blocking I/O 和 select()
Beej's Guide to C Programming (2007)原评论 ↗
推荐chaoticmass · 2017-09

“I remember using Beej's guide to learn how to do TCP/IP stuff in C around ten years ago. Very well written and easy to follow.”

说十年前靠它学 C 下的 TCP/IP,写得好又易懂
Beej's Guide to C Programming (2007)原评论 ↗
推荐acomjean · 2018-02

“I found beej's guide useful as well.”

说自己也觉得它很有用
Web application from scratch, part I原评论 ↗
推荐shawn · 2018-04

“When I was a kid I taught myself network programming with Beej's guide: Beej's Guide to Network Programming”

说自己小时候靠它自学了网络编程
Show HN: Implementing UDP live – Write webgames today that use UDP, not TCP原评论 ↗
推荐kylel · 2018-08

“Beej's guides are great! He does a fantastic job of describing concepts and showing implementations. I also recommend his networking guide: Beej's Guide to Network Programming”

称赞 Beej 讲概念和给实现都很出色,推荐其网络指南
Beej's Quick Guide to GDB (2009)原评论 ↗
推荐29athrowaway · 2018-12

“If you are interested in learning a lot of those at the same time, write a server in C.”

建议想同时学多个系统主题,就用 C 写个服务器
Things I Don’t Know as of 2018原评论 ↗