Lines Matching defs:sock
537 curl_socket_t sock, *fdarr, *wsasocks;
646 sock = fdarr[idx];
647 fds = curlx_sktosi(sock);
655 FD_CLR(sock, writefds);
656 FD_CLR(sock, exceptfds);
660 FD_CLR(sock, readfds);
661 FD_CLR(sock, exceptfds);
669 FD_CLR(sock, readfds);
673 FD_CLR(sock, writefds);
686 FD_CLR(sock, exceptfds);
691 if(FD_ISSET(sock, readfds) || FD_ISSET(sock, writefds) ||
692 FD_ISSET(sock, exceptfds)) {
698 FD_CLR(sock, readfds);
699 FD_CLR(sock, writefds);
700 FD_CLR(sock, exceptfds);
1006 static curl_socket_t sockdaemon(curl_socket_t sock,
1022 rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
1035 sclose(sock);
1040 sclose(sock);
1065 rc = bind(sock, &listener.sa, sizeof(listener.sa4));
1073 rc = bind(sock, &listener.sa, sizeof(listener.sa6));
1080 sclose(sock);
1098 if(getsockname(sock, &localaddr.sa, &la_size) < 0) {
1102 sclose(sock);
1123 sclose(sock);
1131 return sock;
1135 rc = listen(sock, 5);
1139 sock, error, strerror(error));
1140 sclose(sock);
1144 return sock;
1151 curl_socket_t sock = CURL_SOCKET_BAD;
1276 sock = socket(AF_INET, SOCK_STREAM, 0);
1279 sock = socket(AF_INET6, SOCK_STREAM, 0);
1282 if(CURL_SOCKET_BAD == sock) {
1304 rc = connect(sock, &me.sa, sizeof(me.sa4));
1315 rc = connect(sock, &me.sa, sizeof(me.sa6));
1326 msgsock = sock; /* use this as stream */
1330 sock = sockdaemon(sock, &port);
1331 if(CURL_SOCKET_BAD == sock) {
1354 juggle_again = juggle(&msgsock, sock, &mode);
1359 if((msgsock != sock) && (msgsock != CURL_SOCKET_BAD))
1362 if(sock != CURL_SOCKET_BAD)
1363 sclose(sock);