Lines Matching refs:tcpfd
270 int tcpfd, fd;
288 if ((tcpfd = socket(AF_INET6, SOCK_STREAM, 0)) == -1)
292 setsockopt(tcpfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1 ||
294 setsockopt(tcpfd, IPV6_LEVEL, IPV6_V6ONLY, &opt, sizeof(opt)) == -1 ||
296 !fix_fd(tcpfd) ||
302 bind(tcpfd, (struct sockaddr *)&addr, sa_len(&addr)) == -1 ||
303 listen(tcpfd, 5) == -1 ||
309 l->tcpfd = tcpfd;
324 int tcpfd = -1, fd = -1, tftpfd = -1;
338 (tcpfd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
341 if (setsockopt(tcpfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1 ||
342 bind(tcpfd, (struct sockaddr *)&addr, sa_len(&addr)) == -1 ||
343 listen(tcpfd, 5) == -1 ||
344 !fix_fd(tcpfd) ||
382 l->tcpfd = tcpfd;
405 new->tcpfd = -1;
411 if ((new->tcpfd = socket(iface->addr.sa.sa_family, SOCK_STREAM, 0)) == -1 ||
414 setsockopt(new->tcpfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1 ||
415 !fix_fd(new->tcpfd) ||
423 setsockopt(new->tcpfd, IPV6_LEVEL, IPV6_V6ONLY, &opt, sizeof(opt)) == -1)
447 if (rc == -1 || bind(new->tcpfd, &iface->addr.sa, sa_len(&iface->addr)) == -1)
454 if (listen(new->tcpfd, 5) == -1)