Lines Matching refs:server_fd
38 static void ConnectAndAccept(enum LoopbackAddr addr, int server_fd, int port) {
88 if ((accepted_fd = accept(server_fd,
98 static void CreateServer(int* server_fd, int* port) {
103 if ((*server_fd = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP)) == -1) {
111 if (bind(*server_fd, (struct sockaddr*)(&sa), sizeof(sa)) == -1) {
115 if (getsockname(*server_fd, (struct sockaddr*)(&sa), &addr_len) == -1) {
119 if (listen(*server_fd, 10) == -1) {
130 int server_fd, client_fd, accepted_fd, connect_rc;
132 if ((server_fd = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP)) == -1) {
141 if (bind(server_fd, (struct sockaddr*)(&sa), sizeof(sa)) == -1) {
145 if (getsockname(server_fd, (struct sockaddr*)(&sa), &addr_len) == -1) {
149 if (listen(server_fd, 10) == -1) {
192 if ((accepted_fd = accept(server_fd,
199 close(server_fd);
268 int server_fd, client_fd;
276 server_fd = ThreadedGetServerFD();
278 if (getsockname(server_fd, (struct sockaddr*)(&sa), &addr_len) == -1) {
350 int i, j, server_fd, port;
353 CreateServer(&server_fd, &port);
355 ConnectAndAccept(V4_LOOPBACK, server_fd, port);
359 ConnectAndAccept(V6_MAPPED_V4_LOOPBACK, server_fd, port);
363 ConnectAndAccept(V6_LOOPBACK, server_fd, port);
366 close(server_fd);