Lines Matching refs:sock
791 static curl_socket_t sockdaemon(curl_socket_t sock, in sockdaemon() argument
807 rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, in sockdaemon()
818 sclose(sock); in sockdaemon()
823 sclose(sock); in sockdaemon()
848 rc = bind(sock, &listener.sa, sizeof(listener.sa4)); in sockdaemon()
856 rc = bind(sock, &listener.sa, sizeof(listener.sa6)); in sockdaemon()
863 sclose(sock); in sockdaemon()
881 if(getsockname(sock, &localaddr.sa, &la_size) < 0) { in sockdaemon()
885 sclose(sock); in sockdaemon()
906 sclose(sock); in sockdaemon()
912 rc = listen(sock, 5); in sockdaemon()
916 sock, error, sstrerror(error)); in sockdaemon()
917 sclose(sock); in sockdaemon()
921 return sock; in sockdaemon()
927 curl_socket_t sock = CURL_SOCKET_BAD; in main() local
1035 sock = socket(AF_INET, SOCK_STREAM, 0); in main()
1038 sock = socket(AF_INET6, SOCK_STREAM, 0); in main()
1041 if(CURL_SOCKET_BAD == sock) { in main()
1049 sock = sockdaemon(sock, &port); in main()
1050 if(CURL_SOCKET_BAD == sock) { in main()
1070 juggle_again = incoming(sock); in main()
1075 if((msgsock != sock) && (msgsock != CURL_SOCKET_BAD)) in main()
1078 if(sock != CURL_SOCKET_BAD) in main()
1079 sclose(sock); in main()