Searched refs:server_fd (Results 1 – 2 of 2) sorted by relevance
/DragonOS/user/apps/http_server/ |
H A D | main.c | 176 int server_fd, new_socket, valread; in main() local 183 if ((server_fd = socket(AF_INET, SOCK_STREAM, 0)) == 0) in main() 202 if (bind(server_fd, (struct sockaddr *)&address, sizeof(address)) < 0) in main() 209 if (listen(server_fd, 3) < 0) in main() 220 … if ((new_socket = accept(server_fd, (struct sockaddr *)&address, (socklen_t *)&addrlen)) < 0) in main() 237 close(server_fd); in main()
|
/DragonOS/user/apps/test_bind/ |
H A D | main.c | 171 int server_fd; in main() local 175 if ((server_fd = socket(AF_INET, SOCK_STREAM, 0)) == 0) in main() 193 if (bind(server_fd, (struct sockaddr *)&address, sizeof(address)) < 0) in main() 207 if (listen(server_fd, 3) < 0) in main() 215 if (close(server_fd) < 0) in main()
|