From 5a583aa361eb901aaa5accece7c10bba440a499c Mon Sep 17 00:00:00 2001 From: Daniel Harris Date: Fri, 22 Jun 2001 21:29:18 +0000 Subject: [PATCH] Correct some typos and clarify. PR: 28352 Submitted by: author --- .../developers-handbook/sockets/chapter.sgml | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/en_US.ISO8859-1/books/developers-handbook/sockets/chapter.sgml b/en_US.ISO8859-1/books/developers-handbook/sockets/chapter.sgml index 2444ee40af..f4c00f849b 100644 --- a/en_US.ISO8859-1/books/developers-handbook/sockets/chapter.sgml +++ b/en_US.ISO8859-1/books/developers-handbook/sockets/chapter.sgml @@ -56,7 +56,7 @@ your head sideways meant yes. Quickly, I started nodding my head up and down. The vendor noticed, took his almonds, and walked away. To an uninformed observer, I did - not changed the body language: I continued using the language of + not change the body language: I continued using the language of shaking and nodding my head. What changed was the meaning of the body language. At first, the vendor and I interpreted the same language as having completely @@ -335,7 +335,7 @@ - + Essential Socket Functions While FreeBSD offers different functions to work with @@ -377,7 +377,7 @@ int socket(int domain, int type, int protocol); Use PF_INET for UDP, TCP and other - Internet protocols. + Internet protocols (IPv4). Five values are defined for the type argument, again, in @@ -385,11 +385,14 @@ int socket(int domain, int type, int protocol); SOCK_. The most common one is SOCK_STREAM, which tells the system you are asking for a reliable - stream delivery service. + stream delivery service (which is + TCP when used with + PF_INET). If you asked for SOCK_DGRAM, you would be requesting a connectionless datagram - delivery service. + delivery service (in our case, + UDP). If you wanted to be in charge of the low-level protocols (such as IP), or even network @@ -710,7 +713,7 @@ struct in_addr { usually do not know whether it stores data most significant byte (MSB) or least significant byte - (LSB) byte first. + (LSB) first. You might be wondering, So, will sockets not handle it for me? @@ -1271,7 +1274,7 @@ int main() { successfully, we are ready to become a daemon: We use fork to create a child process. In - both, the parent and the child the s + both, the parent and the child, the s variable is our socket. The parent process will not need it, so it calls close, then it returns 0 to inform its own parent it @@ -1395,7 +1398,7 @@ int main() { Now, go ahead, save the above source code as daytimed.c (it is customary to end the names of daemons with the letter - d. After you have compiled it, try + d). After you have compiled it, try running it: @@ -1466,7 +1469,7 @@ Connection closed by foreign host. whizkid ttyp0 Jun 19 16:59 (216.127.220.143) xxx ttyp1 Jun 19 16:06 (xx.xx.xx.xx) -&prompt.user; telnet 216.127.220.107 13 +&prompt.user; telnet 216.127.220.143 13 Trying 216.127.220.143... Connected to r47.bfm.org.