Lines Matching refs:fd
41 int fd = -1; in runClient() local
43 fd = ::socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); in runClient()
44 if (fd < 0) { in runClient()
47 if (::connect(fd, addr->ai_addr, addr->ai_addrlen) == 0) { in runClient()
50 ::close(fd); in runClient()
53 if (fd < 0) { in runClient()
57 if (::send(fd, "boop", 4, 0) != 4) { in runClient()
58 ::close(fd); in runClient()
62 ::close(fd); in runClient()
67 int fd = -1; in runServer() local
69 fd = ::socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); in runServer()
70 if (fd < 0) { in runServer()
73 if (::bind(fd, addr->ai_addr, addr->ai_addrlen) == 0) { in runServer()
76 ::close(fd); in runServer()
79 if (fd < 0) { in runServer()
87 ssize_t bytesRead = recvfrom(fd, buffer, sizeof(buffer), 0, in runServer()
95 ::close(fd); in runServer()
99 ::close(fd); in runServer()
110 int fd = ::socket(AF_LOCAL, SOCK_STREAM, 0); in configureBridge() local
111 if (fd < 0) { in configureBridge()
117 int res = ::ioctl(fd, SIOCBRADDBR, kBridgeName); in configureBridge()
120 ::close(fd); in configureBridge()
131 ::close(fd); in configureBridge()
135 res = ::ioctl(fd, SIOCBRADDIF, &request); in configureBridge()
139 ::close(fd); in configureBridge()
150 ::close(fd); in configureBridge()
154 res = ::ioctl(fd, SIOCGIFFLAGS, &request); in configureBridge()
158 ::close(fd); in configureBridge()
164 res = ::ioctl(fd, SIOCSIFFLAGS, &request); in configureBridge()
168 ::close(fd); in configureBridge()
173 ::close(fd); in configureBridge()