# Beej's Guide to Network Programming 正體中文版

## Beej's Guide to Network Programming 正體中文版

- [簡介](https://beej.netdpi.net/readme.md)
- [原著資訊](https://beej.netdpi.net/original.md)
- [譯者誌謝](https://beej.netdpi.net/translator_comment.md)
- [進階資料](https://beej.netdpi.net/advanced_ref.md)
- [簡體中文版](https://beej.netdpi.net/chinese-simple.md)
- [中文授權](https://beej.netdpi.net/license.md)
- [聯絡譯者](https://beej.netdpi.net/contact.md)
- [1. 導讀](https://beej.netdpi.net/introduction.md)
- [1.1. 本書的讀者](https://beej.netdpi.net/introduction/readers.md)
- [1.2. 平台與編譯器](https://beej.netdpi.net/introduction/platform_compiler.md)
- [1.3. 官方網頁與書本](https://beej.netdpi.net/introduction/site_and_book.md)
- [1.4. Solaris/SunOS 程式設計師該注意的事](https://beej.netdpi.net/introduction/solaris.md)
- [1.5. Windows 程式設計師該注意的事](https://beej.netdpi.net/introduction/windows.md)
- [1.6. 來信原則](https://beej.netdpi.net/introduction/email.md)
- [1.7. 鏡射站台（Mirroring）](https://beej.netdpi.net/introduction/mirror.md)
- [1.8. 譯者該注意的](https://beej.netdpi.net/introduction/translator.md)
- [1.9. 版權與散佈](https://beej.netdpi.net/introduction/license.md)
- [2. 何謂 Socket](https://beej.netdpi.net/02-what-is-socket.md)
- [2.1 兩種 Internet Sockets](https://beej.netdpi.net/02-what-is-socket/2-1-two-internet-sockets.md)
- [2.2 底層漫談與網路理論](https://beej.netdpi.net/02-what-is-socket/2-2-base-and-network-theory.md)
- [3. IP address、結構與資料轉換](https://beej.netdpi.net/ipaddress_struct.md)
- [3.1. IPv4 與 IPv6](https://beej.netdpi.net/ipaddress_struct/ipv4_yu_ipv6.md)
- [3.1.1. Sub network (子網段)](https://beej.netdpi.net/ipaddress_struct/ipv4_yu_ipv6/sub-network.md)
- [3.1.2. Port Number（連接埠號碼）](https://beej.netdpi.net/ipaddress_struct/ipv4_yu_ipv6/port-number.md)
- [3.2. Byte Order（位元組順序）](https://beej.netdpi.net/ipaddress_struct/byte_order.md)
- [3.3. 資料結構](https://beej.netdpi.net/ipaddress_struct/data_struct.md)
- [3.4. IP 位址，續集](https://beej.netdpi.net/ipaddress_struct/ip_set.md)
- [3.4.1 Private Network](https://beej.netdpi.net/ipaddress_struct/ip_set/private-network.md)
- [4. 從 IPv4 移植為 IPv6](https://beej.netdpi.net/04-port-ipv4-to-ipv6.md)
- [5. System call 或 Bust](https://beej.netdpi.net/05-system-call-or-bust.md)
- [5.1. getaddrinfo()－準備開始！](https://beej.netdpi.net/05-system-call-or-bust/5-1-getaddrinfo-start.md)
- [5.2. socket()－取得 File Descriptor！](https://beej.netdpi.net/05-system-call-or-bust/5-2-socket--get-file-descriptor.md)
- [5.3. bind()－ 我在哪個 port？](https://beej.netdpi.net/05-system-call-or-bust/5-3-bind--what-port-am-i-on.md)
- [5.4. connect()，嘿！你好。](https://beej.netdpi.net/05-system-call-or-bust/5connect.md)
- [5.5. listen()－有人會呼叫我嗎？](https://beej.netdpi.net/05-system-call-or-bust/5listen.md)
- [5.6. accept()－ 謝謝你 call 3490 port](https://beej.netdpi.net/05-system-call-or-bust/5accept.md)
- [5.7. send() 與 recv()－ 寶貝，我們來聊天！](https://beej.netdpi.net/05-system-call-or-bust/5send.md)
- [5.8. sendto() 與 recvfrom()－ 來點 DGRAM](https://beej.netdpi.net/05-system-call-or-bust/5sendto.md)
- [5.9. close() 與 shutdown()－ 你消失吧！](https://beej.netdpi.net/05-system-call-or-bust/5close.md)
- [5.10. getpeername()－你是誰？](https://beej.netdpi.net/05-system-call-or-bust/5getpeername.md)
- [5.11. gethostname()－我是誰？](https://beej.netdpi.net/05-system-call-or-bust/5gethostname.md)
- [6. Client-Server 基礎](https://beej.netdpi.net/client-server_basic.md)
- [6.1. 簡單的 Stream Server](https://beej.netdpi.net/client-server_basic/stream_server.md)
- [6.2. 簡單的 Stream Client](https://beej.netdpi.net/client-server_basic/stream_client.md)
- [6.3. Datagram Sockets](https://beej.netdpi.net/client-server_basic/datagram_sockets.md)
- [7. 進階技術](https://beej.netdpi.net/advanced_tech.md)
- [7.1. Blocking（阻塞）](https://beej.netdpi.net/advanced_tech/blocking.md)
- [7.2. select()：同步 I/O 多工](https://beej.netdpi.net/advanced_tech/7selec.md)
- [7.3. 不完整傳送的後續處理](https://beej.netdpi.net/advanced_tech/7incomplete.md)
- [7.4. Serialization：如何封裝資料](https://beej.netdpi.net/advanced_tech/7serialization.md)
- [7.5. 資料封裝](https://beej.netdpi.net/advanced_tech/7_encap.md)
- [7.6. 廣播封包：Hello World！](https://beej.netdpi.net/advanced_tech/7broadcast.md)
- [8. 常見的問題](https://beej.netdpi.net/faq.md)
- [9. Man 使用手冊](https://beej.netdpi.net/man.md)
- [9.1. accept()](https://beej.netdpi.net/man/accept.md)
- [9.2. bind()](https://beej.netdpi.net/man/bind.md)
- [9.3. connect()](https://beej.netdpi.net/man/connect.md)
- [9.4. close()](https://beej.netdpi.net/man/close.md)
- [9.5. getaddrinfo(), freeaddrinfo(), gai\_strerror()](https://beej.netdpi.net/man/getaddrinfo-_freeaddrinfo-_gaistrerror.md)
- [9.6. gethostname()](https://beej.netdpi.net/man/gethostname.md)
- [9.7. gethostbyname(), gethostbyaddr()](https://beej.netdpi.net/man/gethostbyname-_gethostbyaddr.md)
- [9.8. getnameinfo()](https://beej.netdpi.net/man/getnameinfo.md)
- [9.9. getpeername()](https://beej.netdpi.net/man/getpeername.md)
- [9.10. errno](https://beej.netdpi.net/man/errno.md)
- [9.11. fcntl()](https://beej.netdpi.net/man/fcntl.md)
- [9.12. htons(), htonl(), ntohs(), ntohl()](https://beej.netdpi.net/man/htons-_htonl-_ntohs-_ntohl.md)
- [9.13. inet\_ntoa(), inet\_aton(), inet\_addr](https://beej.netdpi.net/man/inetntoa_-_inetaton_-_inetaddr.md)
- [9.14. inet\_ntop(), inet\_pton()](https://beej.netdpi.net/man/inetntop_-_inetpton.md)
- [9.15. listen()](https://beej.netdpi.net/man/listen.md)
- [9.16. perror(), strerror()](https://beej.netdpi.net/man/perror-_strerror.md)
- [9.17. poll()](https://beej.netdpi.net/man/poll.md)
- [9.18. recv(), recvfrom()](https://beej.netdpi.net/man/recv-_recvfrom.md)
- [9.19. select()](https://beej.netdpi.net/man/select.md)
- [9.20. setsockopt(), getsockopt()](https://beej.netdpi.net/man/setsockopt-_getsockopt.md)
- [9.21. send(), sendto()](https://beej.netdpi.net/man/send-_sendto.md)
- [9.22. shutdown()](https://beej.netdpi.net/man/shutdown.md)
- [9.23. socket()](https://beej.netdpi.net/man/socket.md)
- [9.24. struct sockaddr and pals](https://beej.netdpi.net/man/struct_sockaddr_and_pals.md)
- [10. 參考資料](https://beej.netdpi.net/reference.md)
- [10.1. 書籍](https://beej.netdpi.net/reference/ref_books.md)
- [10.2. 網站參考資料](https://beej.netdpi.net/reference/ref_webs.md)
- [10.3. RFC](https://beej.netdpi.net/reference/rfc.md)
- [11. 原著誌謝](https://beej.netdpi.net/original_comment.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information, you can query the documentation dynamically by asking a question.
Perform an HTTP GET request on a page URL with the `ask` query parameter:
```
GET https://beej.netdpi.net/readme.md?ask=<question>
```
The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.
Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
