Lines Matching full:sock
160 static int connect_with_timeout(int sock, const struct sockaddr *nsap,
162 static int retrying_select(const int sock, fd_set *readset, fd_set *writeset,
944 connect_with_timeout(int sock, const struct sockaddr *nsap, socklen_t salen, int sec)
950 origflags = fcntl(sock, F_GETFL, 0);
951 fcntl(sock, F_SETFL, origflags | O_NONBLOCK);
953 res = connect(sock, nsap, salen);
963 __libc_format_log(ANDROID_LOG_DEBUG, "libc", " %d send_vc\n", sock);
966 res = retrying_select(sock, &rset, &wset, &finish);
972 fcntl(sock, F_SETFL, origflags);
975 " %d connect_with_timeout returning %d\n", sock, res);
981 retrying_select(const int sock, fd_set *readset, fd_set *writeset, const struct timespec *finish)
990 __libc_format_log(ANDROID_LOG_DEBUG, "libc", " %d retying_select\n", sock);
996 FD_SET(sock, readset);
1000 FD_SET(sock, writeset);
1007 n = pselect(sock + 1, readset, writeset, NULL, &timeout, NULL);
1011 " %d retrying_select timeout\n", sock);
1021 " %d retrying_select got error %d\n",sock, n);
1025 if ((readset && FD_ISSET(sock, readset)) || (writeset && FD_ISSET(sock, writeset))) {
1027 if (getsockopt(sock, SOL_SOCKET, SO_ERROR, &error, &len) < 0 || error) {
1031 " %d retrying_select dot error2 %d\n", sock, errno);
1039 " %d retrying_select returning %d\n",sock, n);