File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11281128hi.ai\_socktype = SOCK\_STREAM; hi.ai\_flags = AI\_PASSIVE;
11291129\emprg{getaddrinfo}(NULL, portstr, &hi, &rorig);
11301130for (r = rorig; r != NULL; r = r->ai\_next) \{
1131- fd = \emprg{socket}(r->ai\_family, r->ai\_socktype,
1131+ int fd = \emprg{socket}(r->ai\_family, r->ai\_socktype,
11321132 r->ai\_protocol);
11331133 if (!\emprg{bind}(fd, r->ai\_addr, r->ai\_addrlen)) break;
11341134\}
11351135\emprg{freeaddrinfo}(rorig); \emprg{listen}(fd, nclients);
11361136for (;;) \{ sz = sizeof(ca);
1137- nfd = \emprg{accept}(fd, (struct sockaddr *)&ca, &sz);
1137+ int nfd = \emprg{accept}(fd, (struct sockaddr *)&ca, &sz);
11381138 /* communication with the client */
1139- close(newsock );
1139+ close(nfd );
11401140\}
11411141\end {alltt }
11421142\end {slide }
You can’t perform that action at this time.
0 commit comments