Lines Matching refs:info_p

161  *  info_p:	pointer to a server infomation
166 void delete_zombies(struct server_info *info_p)
171 while (info_p->current_connection) {
178 --info_p->current_connection;
180 ++info_p->lost_connection;
184 info_p->lost_connection);
195 * The socket discripter is stored info_p->listen_sd.
198 * info_p: pointer to a server infomation
203 void create_listen_socket(struct server_info *info_p)
212 hints.ai_family = info_p->family;
218 err = getaddrinfo(NULL, info_p->portnum, &hints, &res);
229 info_p->listen_sd = socket(res->ai_family,
231 if (info_p->listen_sd < 0)
238 if (setsockopt(info_p->listen_sd,
246 if (setsockopt(info_p->listen_sd,
251 if (info_p->small_sending) {
253 if (setsockopt(info_p->listen_sd,
262 if (info_p->window_scaling)
263 maximize_sockbuf(info_p->listen_sd);
266 if (bind(info_p->listen_sd, res->ai_addr, res->ai_addrlen) < 0)
271 if (listen(info_p->listen_sd, 5) < 0)
285 * info_p: pointer to a server infomation
291 int communicate_client(struct server_info *info_p, int sock_fd)
299 if (info_p->small_sending) { /* small sending mode */
374 * info_p: pointer to a server infomation
380 int handle_client(struct server_info *info_p)
387 info_p->current_connection = 0;
389 FD_SET(info_p->listen_sd, &read_fds);
390 max_read_fd = info_p->listen_sd;
410 if (close(info_p->listen_sd))
429 if (close(info_p->listen_sd))
433 if (info_p->concurrent)
434 delete_zombies(info_p);
439 if (FD_ISSET(info_p->listen_sd, &active_fds)) {
443 accept(info_p->listen_sd,
452 if (close(info_p->listen_sd))
462 if (info_p->concurrent) { /* concurrent server. */
469 if (close(info_p->listen_sd))
475 if (close(info_p->listen_sd))
478 communicate_client(info_p,
490 ++info_p->current_connection;
491 if (info_p->max_connection <
492 info_p->
494 info_p->max_connection =
495 info_p->
500 info_p->
503 delete_zombies(info_p);
507 communicate_client(info_p, data_sd);
509 if (close(info_p->listen_sd))
516 if (info_p->concurrent)
517 delete_zombies(info_p);
518 if (info_p->current_connection == 0)