
"12~ Index m
CatcbAlarm(), 59
character encoding, 26
child processes, 60, 63, 64, 72
clients
client-side connection
establishment, 93-94
closing handshake, 97-100
opening handshake, 94, 95,
97
overview, 6- 7
as peers, 6
per-client processes, 60-67
per-client threads, 67-70
servers vs., 7, 12
TCP clients, 12-17
UDP clients, 36-39
close(), 97-99
API reference, 117
child and parent processes
and, 63
data in SendQ and, 99
destroying socket instances,
10
graceful close, 97
linger behavior, 99
one application calls first, 97,
98, 99
return values, 10
shutdown() vs., 97, 99
simultaneous calls to, 97, 98
SO_LINGER socket option, 45
syntax, 10
TCP client connection, 12, 13
TCP server connection, 17,
18
Closed state, 94
closing connections, 97-100
close() vs. shutdown(), 97, 99
data in SendQ and, 99
graceful close, 97
simultaneous calls to
close(), 97, 98
Time-Wait state and, 99-100
using linger behavior, 99
when one application calls
close() first, 97, 98, 99
communication channels, 3, 5
concurrent servers, 60
connect ()
API reference, 113
blocking, 50
client-side connection
establishment, 93-94
connection time problems,
6O
nonblocking, 50, 51
opening handshake, 94
return values, 94
syntax, 12
for TCP clients, 12, 17
in TCPEchoClient. c, 15
TCPEchoServer. c and, 21
timeout of, 94
UDPEchoClient. c and, 36, 38
Connecting state, 95
connecting with TCP, 93-97
accept() processing, 95-97
client-side connection
establishment, 93-94
incoming connection request
processing, 95, 96
opening handshake, 94, 95,
97
server-side socket setup,
94-97
constrained multitasking, 70-72
overview, 70-71
TCPEchoServer-ForkN. c,
71-72
constrained-multitasking
servers, 70
CreateTCPServerSocket (),
63
CreateTCPServerSocket. c, 65
data structures, 87-88, 111-112
datagram sockets, 7
deadlock, 91-92
delimiters of fields, 26
Delivered, 89-91, 99
demultiplexing, 100-102
deposits, 25, 26-27
DieWithError. c, 16-17
directed broadcast, 77-78
DNS (Domain Name System),
103,104
domain name service, 103-108
finding service information
by name, 106-108
information sources, 103
mapping between names
and Internet addresses,
104-106
overview, 103
Domain Name System (DNS),
103, 104
dotted-quad notation, 6
EADDRINUSE, 100, 101,112
EAGAIN, 50
ECONNREFUSED, 94
EINPROGRESS, 50, 51
EINTR
signal handling and, 49
in
UDPEchoClient-Timeout. c,
56, 59
in UDPEchoServer-SIGI0. c, 55
with zombies, 64
encoding data, 26-28
binary numbers, 27-28
byte ordering, 28-30
character encoding, 26
framing, 31- 33
numbers as text strings,
26-27, 32-33
presentation service, 33
end-to-end transport protocols
defined, 5
specifying for socket
instances, 9-10
errno, 16, 55, 59, 94, 104
Established state, 93, 96, 97
ETIMEDOUT, 94, 99
EWOULDBLOCK, 50, 51, 55, 89
exit(),
63
FASYNC, 52, 55
fcntl(), 51, 52
FD_CLR(), 73
FD_ISSET(), 73
fd_set,
73
FD_SET(), 73
FD_ZERO0, 73
F_GETFL, 51
fields of messages, 25, 26
FIFO queues, 87, 89-93
flow control, 91
fork(), 60, 61, 63
framing messages, 31-33
F_SETFL, 51
F_SETOWN, 55
gethostbyaddr(),
105, 121
gethostbyname(), 104, 105, 120,
121
gethostname(), 105-106, 120
getpeername(), 66-67, i14-I15
getpid(), 69
getservbyname(), i06-108, 121
getservbyport(), i08, 122
getsockname(), 66-67, I13
getsockopt()
API reference, i 18
commonly used options, 45
syntax, 43
using, 44