Lines Matching refs:listen_fd
54 tcp_server(pid_t partner, int listen_fd)
58 accept_fd = accept(listen_fd, NULL, NULL);
66 close(listen_fd);
114 int listen_fd;
127 listen_fd = socket(PF_INET, SOCK_STREAM, 0);
128 if (listen_fd < 0)
140 if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0)
143 if (listen(listen_fd, -1) < 0)
153 if (getsockname(listen_fd, (struct sockaddr *)&sin, &len) < 0)
164 tcp_server(child_pid, listen_fd);
169 close(listen_fd);
175 listen_fd = socket(PF_INET, SOCK_STREAM, 0);
176 if (listen_fd < 0)
188 if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0)
191 if (listen(listen_fd, -1) < 0)
201 if (getsockname(listen_fd, (struct sockaddr *)&sin, &len) < 0)
212 tcp_server(parent_pid, listen_fd);