《Unix网络编程—Socket Networking API》 读书笔记
<
UNIX® Network Programming Volume 1, Third Edition: The Sockets Networking API> Reading Notes
(使用的是2003年的英文第三版)
0 Preface
Introduction:
This book is for people who want to write programs that communicate with each other using an application program interface (API) known as sockets.
The goal of this book is to offer guidance on network programming for beginners as well as professionals, for those developing new network-aware applications as well as those maintaining existing code, and for people who simply want to understand how the networking components of their system function.
When used as a tutorial or for an introductory class on network programming, the emphasis should be onPart 2, "Elementary Sockets" (Chapters 3 through11), followed by whatever additional topics are of interest.Part 2 covers the basic socket functions for both TCP and UDP, along with SCTP, I/O multiplexing, socket options, and basic name and address conversions.
最基本的内容在part 2,所以需要重点学习的也是第二部分。同时第三部分中的一些个人感兴趣的专题也是很有意义去学习的。
学习的最好方式就是结合本书中提供的各个例子加以修改、自动动手去尝试!
Part I Introduction and TCP/IP
Chapter 1. Introduction
1.1 Intro
介绍最基本的网络知识,协议。Even though the client and server communicate using an application protocol, the transport layers communicate using TCP. Note that the actual flow of information between the client and server goes down the protocol stack on one side, across the network, and up the protocol stack on the other side. Also note that the client and server are typically user processes, while the TCP and IP protocols are normally part of the protocol stack within the kernel.
1.2 A simple Client
This client establishes a TCP connection with a server and the server simply sends back the current time and date in a human-readable format.