Lines Matching refs:sock
1211 static curl_socket_t sockdaemon(curl_socket_t sock, in sockdaemon() argument
1227 rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, in sockdaemon()
1240 sclose(sock); in sockdaemon()
1245 sclose(sock); in sockdaemon()
1270 rc = bind(sock, &listener.sa, sizeof(listener.sa4)); in sockdaemon()
1278 rc = bind(sock, &listener.sa, sizeof(listener.sa6)); in sockdaemon()
1285 sclose(sock); in sockdaemon()
1303 if(getsockname(sock, &localaddr.sa, &la_size) < 0) { in sockdaemon()
1307 sclose(sock); in sockdaemon()
1328 sclose(sock); in sockdaemon()
1336 return sock; in sockdaemon()
1340 rc = listen(sock, 5); in sockdaemon()
1344 sock, error, sstrerror(error)); in sockdaemon()
1345 sclose(sock); in sockdaemon()
1349 return sock; in sockdaemon()
1356 curl_socket_t sock = CURL_SOCKET_BAD; in main() local
1483 sock = socket(AF_INET, SOCK_STREAM, 0); in main()
1486 sock = socket(AF_INET6, SOCK_STREAM, 0); in main()
1489 if(CURL_SOCKET_BAD == sock) { in main()
1510 rc = connect(sock, &me.sa, sizeof(me.sa4)); in main()
1521 rc = connect(sock, &me.sa, sizeof(me.sa6)); in main()
1532 msgsock = sock; /* use this as stream */ in main()
1536 sock = sockdaemon(sock, &port); in main()
1537 if(CURL_SOCKET_BAD == sock) { in main()
1567 juggle_again = juggle(&msgsock, sock, &mode); in main()
1572 if((msgsock != sock) && (msgsock != CURL_SOCKET_BAD)) in main()
1575 if(sock != CURL_SOCKET_BAD) in main()
1576 sclose(sock); in main()