Lines Matching refs:fd
395 int c, ret, fd, i = 0, timeout = -1, port = SERVER_PORT; in main() local
503 fd = socket(family, tcp ? SOCK_STREAM : SOCK_DGRAM, in main()
505 if (fd < 0) { in main()
517 if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, in main()
548 ret = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, in main()
554 ret = bind(fd, addr_recv, addr_len); in main()
561 ret = connect(fd, addr_send, addr_len); in main()
608 ret = write(fd, &buf_ptr[pos], in main()
617 ret = sendto(fd, buf_ptr, len, 0, addr_send, in main()
630 FD_SET(fd, &rfds); in main()
640 ret = select(fd + 1, &rfds, NULL, NULL, &tv); in main()
662 } else if (!FD_ISSET(fd, &rfds)) { in main()
674 ret = read(fd, buf + pos, in main()
684 ret = recv(fd, buf, sizeof(buf), 0); in main()
767 close(fd); in main()