Correct some typos and clarify.
PR: 28352 Submitted by: author
This commit is contained in:
parent
d46e1a628f
commit
5a583aa361
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=9672
1 changed files with 12 additions and 9 deletions
|
@ -56,7 +56,7 @@
|
|||
your head sideways meant <emphasis>yes</emphasis>. 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
|
||||
<emphasis>meaning</emphasis> of the body language. At first, the
|
||||
vendor and I interpreted the same language as having completely
|
||||
|
@ -335,7 +335,7 @@
|
|||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="sockets-essetial-functions">
|
||||
<sect1 id="sockets-essential-functions">
|
||||
<title>Essential Socket Functions</title>
|
||||
|
||||
<para>While FreeBSD offers different functions to work with
|
||||
|
@ -377,7 +377,7 @@ int socket(int domain, int type, int protocol);
|
|||
|
||||
<para>Use <constant>PF_INET</constant> for
|
||||
<acronym>UDP</acronym>, <acronym>TCP</acronym> and other
|
||||
Internet protocols.</para>
|
||||
Internet protocols (<acronym>IP</acronym>v4).</para>
|
||||
|
||||
<para>Five values are defined for the
|
||||
<varname>type</varname> argument, again, in
|
||||
|
@ -385,11 +385,14 @@ int socket(int domain, int type, int protocol);
|
|||
<quote><constant>SOCK_</constant></quote>. The most
|
||||
common one is <constant>SOCK_STREAM</constant>, which
|
||||
tells the system you are asking for a <emphasis>reliable
|
||||
stream delivery service</emphasis>.</para>
|
||||
stream delivery service</emphasis> (which is
|
||||
<acronym>TCP</acronym> when used with
|
||||
<constant>PF_INET</constant>).</para>
|
||||
|
||||
<para>If you asked for <constant>SOCK_DGRAM</constant>, you
|
||||
would be requesting a <emphasis>connectionless datagram
|
||||
delivery service</emphasis>.</para>
|
||||
delivery service</emphasis> (in our case,
|
||||
<acronym>UDP</acronym>).</para>
|
||||
|
||||
<para>If you wanted to be in charge of the low-level
|
||||
protocols (such as <acronym>IP</acronym>), or even network
|
||||
|
@ -710,7 +713,7 @@ struct in_addr {
|
|||
usually do not know whether it stores data <emphasis>most
|
||||
significant byte</emphasis> (<acronym>MSB</acronym>) or
|
||||
<emphasis>least significant byte</emphasis>
|
||||
(<acronym>LSB</acronym>) byte first.</para>
|
||||
(<acronym>LSB</acronym>) first.</para>
|
||||
|
||||
<para>You might be wondering, <emphasis><quote>So, will
|
||||
sockets not handle it for me?</quote></emphasis></para>
|
||||
|
@ -1271,7 +1274,7 @@ int main() {
|
|||
successfully, we are ready to become a
|
||||
<emphasis>daemon</emphasis>: We use
|
||||
<function>fork</function> to create a child process. In
|
||||
both, the parent and the child the <varname>s</varname>
|
||||
both, the parent and the child, the <varname>s</varname>
|
||||
variable is our socket. The parent process will not need
|
||||
it, so it calls <function>close</function>, then it
|
||||
returns <constant>0</constant> to inform its own parent it
|
||||
|
@ -1395,7 +1398,7 @@ int main() {
|
|||
<para>Now, go ahead, save the above source code as
|
||||
<filename>daytimed.c</filename> (it is customary to end
|
||||
the names of daemons with the letter
|
||||
<constant>d</constant>. After you have compiled it, try
|
||||
<constant>d</constant>). After you have compiled it, try
|
||||
running it:</para>
|
||||
|
||||
<screen>
|
||||
|
@ -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; <userinput>telnet 216.127.220.107 13</userinput>
|
||||
&prompt.user; <userinput>telnet 216.127.220.143 13</userinput>
|
||||
|
||||
Trying 216.127.220.143...
|
||||
Connected to r47.bfm.org.
|
||||
|
|
Loading…
Reference in a new issue