> For the complete documentation index, see [llms.txt](https://wskdsgcf.gitbook.io/mastering-go-zh-cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wskdsgcf.gitbook.io/mastering-go-zh-cn/13.0.md).

# 13 网络编程 - 构建服务器与客户端

之前的章节讨论了关于网络编程的内容; 包括开发 web 客户端，web 服务端和 web 应用; DNS 查询; 和 HTTP 连接超时。

这章将带您更进一步，向您展示怎样编写您自己的 TCP 客户端和服务端，还有 UDP 客户端和服务端。此外，通过俩个例子展示怎样编写一个并发的 TCP 服务端。第一个例子相当简单，并发的 TCP 服务端只返回斐波那契序列数字。而第二个例子将使用[第四章](https://github.com/hantmac/Mastering_Go_ZH_CN/blob/master/eBook/chapter4/04.0.md)（组合类型的使用）的 keyValue.go 应用的代码，在它的基础上，把**key-value 存储**转变为一个并发 TCP 应用，可以在不需要浏览器的情况下操作。

在玩转 Go的这一章中，您将了解到如下内容：

1. net 标准包
2. TCP 客户端和服务端
3. 实现并发 TCP 服务端
4. UDP 客户端和服务端
5. 修改 [第八章](https://github.com/hantmac/Mastering_Go_ZH_CN/blob/master/eBook/chapter8/08.0.md)的 kvSaveLoad.go，告诉一个 *Unix 系统* 做什么，才能通过 TCP 连接提供请求
6. RCP 客户端和服务端
