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