Lines Matching refs:sock
288 curl_socket_t sock = socket(AF_INET, SOCK_STREAM, 0); in socksconnect() local
289 if(sock == CURL_SOCKET_BAD) in socksconnect()
297 rc = connect(sock, &me.sa, sizeof(me.sa4)); in socksconnect()
306 return sock; in socksconnect()
801 static curl_socket_t sockdaemon(curl_socket_t sock, in sockdaemon() argument
821 rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, in sockdaemon()
834 sclose(sock); in sockdaemon()
839 sclose(sock); in sockdaemon()
863 rc = bind(sock, &listener.sa, sizeof(listener.sa4)); in sockdaemon()
871 rc = bind(sock, &listener.sa, sizeof(listener.sa6)); in sockdaemon()
876 rc = bind_unix_socket(sock, unix_socket, &listener.sau); in sockdaemon()
890 sclose(sock); in sockdaemon()
910 if(getsockname(sock, &localaddr.sa, &la_size) < 0) { in sockdaemon()
914 sclose(sock); in sockdaemon()
935 sclose(sock); in sockdaemon()
941 rc = listen(sock, 5); in sockdaemon()
945 sock, error, sstrerror(error)); in sockdaemon()
946 sclose(sock); in sockdaemon()
950 return sock; in sockdaemon()
956 curl_socket_t sock = CURL_SOCKET_BAD; in main() local
1088 sock = socket(socket_domain, SOCK_STREAM, 0); in main()
1090 if(CURL_SOCKET_BAD == sock) { in main()
1099 sock = sockdaemon(sock, &port in main()
1104 if(CURL_SOCKET_BAD == sock) { in main()
1135 juggle_again = incoming(sock); in main()
1140 if((msgsock != sock) && (msgsock != CURL_SOCKET_BAD)) in main()
1143 if(sock != CURL_SOCKET_BAD) in main()
1144 sclose(sock); in main()