Lines Matching refs:sock_fd
135 int sock_fd; /* socket descriptor for a connection */
270 sock_fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
271 if (sock_fd < 0)
276 if (setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int)))
281 maximize_sockbuf(sock_fd);
284 if (connect(sock_fd, res->ai_addr, res->ai_addrlen) < 0)
298 (sock_fd, SOL_SOCKET, SO_RCVBUF, &recvbuf_size, &sock_optlen) < 0)
301 fprintf(stderr, "recvbuf size of socket(%d) is %d\n", sock_fd,
319 recvbyte_size = recv(sock_fd, recvbuf, recvbuf_size, 0);
337 if (close(sock_fd) < 0)