Algorithm of creating a server socket of type @c SOCK_STREAM
Call socket() on
srvr
PCO with the following parameters:domain
,SOCK_STREAM
,proto
. Created socket is referred assrvr_s
below;If
srvr_wild
is true, fill in network address part ofsrvr_bind_addr
with wildcard network address;Copy port part of
srvr_addr
to port part ofsrvr_bind_addr
address;Bind
srvr_s
socket tosrvr_bind_addr
address.If port part of
srvr_addr
is zero (not specified), then call getsockname() onsrvr_s
socket to obtain the assigned port and set it to the port part ofsrvr_addr
.Call listen() for
srvr_s
socket with default backlog.