/curl/docs/examples/ |
H A D | externalsocket.c | 76 curl_socket_t sockfd; in opensocket() local 79 sockfd = *(curl_socket_t *)clientp; in opensocket() 82 return sockfd; in opensocket() 100 curl_socket_t sockfd; in main() local 120 sockfd = socket(AF_INET, SOCK_STREAM, 0); in main() 121 if(sockfd == CURL_SOCKET_BAD) { in main() 132 close(sockfd); in main() 138 close(sockfd); in main() 151 curl_easy_setopt(curl, CURLOPT_OPENSOCKETDATA, &sockfd); in main() 155 curl_easy_setopt(curl, CURLOPT_CLOSESOCKETDATA, &sockfd); in main() [all …]
|
H A D | sendrecv.c | 34 static int wait_on_socket(curl_socket_t sockfd, int for_recv, long timeout_ms) in wait_on_socket() argument 58 FD_SET(sockfd, &errfd); /* always check for error */ in wait_on_socket() 61 FD_SET(sockfd, &infd); in wait_on_socket() 64 FD_SET(sockfd, &outfd); in wait_on_socket() 73 res = select((int)sockfd + 1, &infd, &outfd, &errfd, &tv); in wait_on_socket() 95 curl_socket_t sockfd; in main() local 109 res = curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sockfd); in main() 129 if(res == CURLE_AGAIN && !wait_on_socket(sockfd, 0, 60000L)) { in main() 154 if(res == CURLE_AGAIN && !wait_on_socket(sockfd, 1, 60000L)) { in main()
|
H A D | multi-event.c | 41 curl_socket_t sockfd; member 46 static curl_context_t *create_curl_context(curl_socket_t sockfd) in create_curl_context() argument 52 context->sockfd = sockfd; in create_curl_context() 54 context->event = event_new(base, sockfd, 0, curl_perform, context); in create_curl_context() 137 curl_multi_socket_action(curl_handle, context->sockfd, flags, in curl_perform() 191 event_assign(curl_context->event, base, curl_context->sockfd, events, in handle_socket()
|
H A D | ephiperfifo.c | 106 curl_socket_t sockfd; member 256 if(f->sockfd) { in remsock() 259 f->sockfd, strerror(errno)); in remsock() 275 if(f->sockfd) { in setsock() 278 f->sockfd, strerror(errno)); in setsock() 281 f->sockfd = s; in setsock() 417 curl_socket_t sockfd; in init_fifo() local 434 if(sockfd == -1) { in init_fifo() 439 g->fifofd = sockfd; in init_fifo() 440 g->input = fdopen(sockfd, "r"); in init_fifo() [all …]
|
H A D | multi-uv.c | 51 curl_socket_t sockfd; member 55 static curl_context_t *create_curl_context(curl_socket_t sockfd, in create_curl_context() argument 62 context->sockfd = sockfd; in create_curl_context() 65 uv_poll_init_socket(uv->loop, &context->poll_handle, sockfd); in create_curl_context() 152 curl_multi_socket_action(context->uv->multi, context->sockfd, flags, in on_uv_socket()
|
H A D | hiperfifo.c | 106 curl_socket_t sockfd; member 256 f->sockfd = s; in setsock() 262 event_assign(&f->ev, g->evbase, f->sockfd, kind, event_cb, g); in setsock() 398 curl_socket_t sockfd; in init_fifo() local 413 sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0); in init_fifo() 414 if(sockfd == -1) { in init_fifo() 418 g->input = fdopen(sockfd, "r"); in init_fifo() 421 event_assign(&g->fifo_event, g->evbase, sockfd, EV_READ|EV_PERSIST, in init_fifo()
|
H A D | evhiperfifo.c | 108 curl_socket_t sockfd; member 255 f->sockfd = s; in setsock() 260 ev_io_init(&f->ev, event_cb, f->sockfd, kind); in setsock() 396 curl_socket_t sockfd; in init_fifo() local 411 sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0); in init_fifo() 412 if(sockfd == -1) { in init_fifo() 416 g->input = fdopen(sockfd, "r"); in init_fifo() 419 ev_io_init(&g->fifo_event, fifo_cb, sockfd, EV_READ); in init_fifo()
|
/curl/lib/ |
H A D | nonblock.c | 46 int curlx_nonblock(curl_socket_t sockfd, /* operate on this */ in curlx_nonblock() argument 52 flags = sfcntl(sockfd, F_GETFL, 0); in curlx_nonblock() 64 return sfcntl(sockfd, F_SETFL, flags); in curlx_nonblock() 70 return ioctl(sockfd, FIONBIO, &flags); in curlx_nonblock() 76 return ioctlsocket(sockfd, (long)FIONBIO, &flags); in curlx_nonblock() 82 return IoctlSocket(sockfd, FIONBIO, (char *)&flags); in curlx_nonblock() 88 return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); in curlx_nonblock()
|
H A D | memdebug.c | 307 curl_socket_t sockfd; in curl_dbg_socket() local 312 sockfd = socket(domain, type, protocol); in curl_dbg_socket() 314 if(source && (sockfd != CURL_SOCKET_BAD)) in curl_dbg_socket() 316 source, line, sockfd); in curl_dbg_socket() 318 return sockfd; in curl_dbg_socket() 329 rc = send(sockfd, buf, len, flags); in curl_dbg_send() 343 rc = recv(sockfd, buf, len, flags); in curl_dbg_recv() 376 source, line, sockfd); in curl_dbg_accept() 378 return sockfd; in curl_dbg_accept() 386 source, line, sockfd); in curl_dbg_mark_sclose() [all …]
|
H A D | memdebug.h | 80 CURL_EXTERN void curl_dbg_mark_sclose(curl_socket_t sockfd, 82 CURL_EXTERN int curl_dbg_sclose(curl_socket_t sockfd, 93 CURL_EXTERN SEND_TYPE_RETV curl_dbg_send(SEND_TYPE_ARG1 sockfd, 98 CURL_EXTERN RECV_TYPE_RETV curl_dbg_recv(RECV_TYPE_ARG1 sockfd, 180 #define sclose(sockfd) curl_dbg_sclose(sockfd,__LINE__,__FILE__) argument 182 #define fake_sclose(sockfd) curl_dbg_mark_sclose(sockfd,__LINE__,__FILE__) argument
|
H A D | cf-socket.c | 122 (void)sockfd; in tcpnodelay() 187 sockfd, SOCKERRNO); in tcpkeepalive() 199 sockfd, SOCKERRNO); in tcpkeepalive() 207 sockfd, SOCKERRNO); in tcpkeepalive() 214 sockfd, SOCKERRNO); in tcpkeepalive() 240 sockfd, SOCKERRNO); in tcpkeepalive() 250 sockfd, SOCKERRNO); in tcpkeepalive() 260 sockfd, SOCKERRNO); in tcpkeepalive() 270 sockfd, SOCKERRNO); in tcpkeepalive() 369 if(*sockfd == CURL_SOCKET_BAD) in socket_open() [all …]
|
H A D | nonblock.h | 29 int curlx_nonblock(curl_socket_t sockfd, /* operate on this */
|
H A D | cf-socket.h | 74 curl_socket_t *sockfd); 89 void Curl_sndbuf_init(curl_socket_t sockfd);
|
H A D | tftp.c | 129 curl_socket_t sockfd; member 525 senddata = sendto(state->sockfd, (void *)state->spacket.data, in tftp_send_first() 610 sbytes = sendto(state->sockfd, (void *)state->spacket.data, in tftp_rx() 635 sbytes = sendto(state->sockfd, (void *)state->spacket.data, in tftp_rx() 661 sbytes = sendto(state->sockfd, (void *)state->spacket.data, in tftp_rx() 675 (void)sendto(state->sockfd, (void *)state->spacket.data, in tftp_rx() 782 sbytes = sendto(state->sockfd, (void *) state->spacket.data, in tftp_tx() 808 sbytes = sendto(state->sockfd, (void *)state->spacket.data, in tftp_tx() 1006 state->sockfd = conn->sock[FIRSTSOCKET]; in tftp_connect() 1107 state->rbytes = (int)recvfrom(state->sockfd, in tftp_receive_packet() [all …]
|
H A D | gopher.c | 137 curl_socket_t sockfd = conn->sock[FIRSTSOCKET]; in gopher_do() local 218 what = SOCKET_WRITABLE(sockfd, timeout_ms); in gopher_do()
|
H A D | transfer.c | 168 if(data->conn->sockfd == CURL_SOCKET_BAD) in xfer_recv_shutdown() 170 sockindex = (data->conn->sockfd == data->conn->sock[SECONDARYSOCKET]); in xfer_recv_shutdown() 180 if(data->conn->sockfd == CURL_SOCKET_BAD) in xfer_recv_shutdown_started() 182 sockindex = (data->conn->sockfd == data->conn->sock[SECONDARYSOCKET]); in xfer_recv_shutdown_started() 798 conn->sockfd = sockindex == -1 ? in xfer_setup() 801 conn->writesockfd = conn->sockfd; in xfer_setup() 807 conn->sockfd = sockindex == -1 ? in xfer_setup() 969 sockindex = ((data->conn->sockfd != CURL_SOCKET_BAD) && in Curl_xfer_recv() 970 (data->conn->sockfd == data->conn->sock[SECONDARYSOCKET])); in Curl_xfer_recv()
|
/curl/docs/libcurl/opts/ |
H A D | CURLOPT_OPENSOCKETDATA.md | 43 /* make libcurl use the already established socket 'sockfd' */ 49 curl_socket_t sockfd; 50 sockfd = *(curl_socket_t *)clientp; 53 return sockfd; 68 extern int sockfd; /* the already connected one */ 75 curl_easy_setopt(curl, CURLOPT_OPENSOCKETDATA, &sockfd);
|
H A D | CURLINFO_ACTIVESOCKET.md | 54 curl_socket_t sockfd; 67 res = curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sockfd); 68 if(!res && sockfd != CURL_SOCKET_BAD) { 69 /* operate on sockfd */
|
H A D | CURLINFO_LASTSOCKET.md | 54 long sockfd; /* does not work on win64 */ 67 res = curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, &sockfd); 68 if(!res && sockfd != -1) { 69 /* operate on sockfd */
|
H A D | CURLOPT_SOCKOPTFUNCTION.md | 83 /* make libcurl use the already established socket 'sockfd' */ 89 curl_socket_t sockfd; 90 sockfd = *(curl_socket_t *)clientp; 93 return sockfd; 108 int sockfd; /* our custom file descriptor */ 114 curl_easy_setopt(curl, CURLOPT_OPENSOCKETDATA, &sockfd);
|
H A D | CURLOPT_OPENSOCKETFUNCTION.md | 84 /* make libcurl use the already established socket 'sockfd' */ 90 curl_socket_t sockfd; 91 sockfd = *(curl_socket_t *)clientp; 94 return sockfd; 109 extern int sockfd; /* the already connected one */ 115 curl_easy_setopt(curl, CURLOPT_OPENSOCKETDATA, &sockfd);
|
/curl/tests/server/ |
H A D | sockfilt.c | 1006 sockfd = listenfd; in juggle() 1008 FD_SET(sockfd, &fds_read); in juggle() 1009 maxfd = (int)sockfd; in juggle() 1014 sockfd = *sockfdp; in juggle() 1023 maxfd = (int)sockfd; in juggle() 1029 sockfd = *sockfdp; in juggle() 1033 maxfd = (int)sockfd; in juggle() 1045 sockfd = CURL_SOCKET_BAD; in juggle() 1145 sclose(sockfd); in juggle() 1159 if((sockfd != CURL_SOCKET_BAD) && (FD_ISSET(sockfd, &fds_read)) ) { in juggle() [all …]
|
/curl/docs/libcurl/ |
H A D | curl_multi_assign.md | 24 CURLMcode curl_multi_assign(CURLM *multi_handle, curl_socket_t sockfd, 35 for the specific *sockfd* socket. 37 If the given *sockfd* is not already in use by libcurl, this function
|
H A D | curl_multi_socket_action.md | 28 curl_socket_t sockfd, 36 should call curl_multi_socket_action(3) with the **sockfd** argument 43 CURL_SOCKET_TIMEOUT to the **sockfd** parameter in order to initiate the 64 **sockfd** argument set to CURL_SOCKET_TIMEOUT. You can also use the
|
H A D | curl_multi_socket.md | 26 CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t sockfd, 52 call the curl_multi_socket_action(3) function with the **sockfd** argument set
|