Home
last modified time | relevance | path

Searched refs:sockfd (Results 1 – 25 of 89) sorted by relevance

1234

/external/skia/experimental/Networking/
DSkSockets.cpp30 int sockfd = socket(AF_INET, SOCK_STREAM, 0); in createSocket() local
31 if (sockfd < 0) { in createSocket()
37 if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(int)) < 0) { in createSocket()
42 this->setNonBlocking(sockfd); in createSocket()
46 return sockfd; in createSocket()
49 void SkSocket::closeSocket(int sockfd) { in closeSocket() argument
53 close(sockfd); in closeSocket()
56 if (FD_ISSET(sockfd, &fMasterSet)) { in closeSocket()
57 FD_CLR(sockfd, &fMasterSet); in closeSocket()
58 if (sockfd >= fMaxfd) { in closeSocket()
[all …]
DSkSockets.h109 void closeSocket(int sockfd);
116 virtual void onFailedConnection(int sockfd);
121 void setNonBlocking(int sockfd);
128 void addToMasterSet(int sockfd);
192 virtual void onFailedConnection(int sockfd);
/external/curl/lib/
Dconnect.c86 static bool verifyconnect(curl_socket_t sockfd, int *error);
107 curl_socket_t sockfd) in tcpkeepalive() argument
112 if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, in tcpkeepalive()
114 infof(data, "Failed to set SO_KEEPALIVE on fd %d\n", sockfd); in tcpkeepalive()
127 if(WSAIoctl(sockfd, SIO_KEEPALIVE_VALS, (LPVOID) &vals, sizeof(vals), in tcpkeepalive()
130 (int)sockfd, WSAGetLastError()); in tcpkeepalive()
136 if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, in tcpkeepalive()
138 infof(data, "Failed to set TCP_KEEPIDLE on fd %d\n", sockfd); in tcpkeepalive()
144 if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL, in tcpkeepalive()
146 infof(data, "Failed to set TCP_KEEPINTVL on fd %d\n", sockfd); in tcpkeepalive()
[all …]
Dnonblock.c47 int curlx_nonblock(curl_socket_t sockfd, /* operate on this */ in curlx_nonblock() argument
58 flags = sfcntl(sockfd, F_GETFL, 0); in curlx_nonblock()
60 return sfcntl(sockfd, F_SETFL, flags | O_NONBLOCK); in curlx_nonblock()
62 return sfcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK)); in curlx_nonblock()
68 return ioctl(sockfd, FIONBIO, &flags); in curlx_nonblock()
74 return ioctlsocket(sockfd, FIONBIO, &flags); in curlx_nonblock()
80 return IoctlSocket(sockfd, FIONBIO, flags); in curlx_nonblock()
86 return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); in curlx_nonblock()
Dmemdebug.c350 curl_socket_t sockfd = socket(domain, type, protocol); in curl_socket() local
352 if(source && (sockfd != CURL_SOCKET_BAD)) in curl_socket()
353 curl_memlog(fmt, source, line, sockfd); in curl_socket()
355 return sockfd; in curl_socket()
390 curl_socket_t sockfd = accept(s, addr, addrlen); in curl_accept() local
392 if(source && (sockfd != CURL_SOCKET_BAD)) in curl_accept()
393 curl_memlog(fmt, source, line, sockfd); in curl_accept()
395 return sockfd; in curl_accept()
399 void curl_mark_sclose(curl_socket_t sockfd, int line, const char *source) in curl_mark_sclose() argument
408 curl_memlog(fmt, source, line, sockfd); in curl_mark_sclose()
[all …]
Dsendf.h27 CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *,
60 CURLcode Curl_read_plain(curl_socket_t sockfd,
71 CURLcode Curl_read(struct connectdata *conn, curl_socket_t sockfd,
76 curl_socket_t sockfd,
82 curl_socket_t sockfd,
Dsendf.c168 CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *conn, in Curl_sendf() argument
190 result = Curl_write(conn, sockfd, sptr, write_len, &bytes_written); in Curl_sendf()
221 curl_socket_t sockfd, in Curl_write() argument
228 int num = (sockfd == conn->sock[SECONDARYSOCKET]); in Curl_write()
256 curl_socket_t sockfd = conn->sock[num]; in Curl_send_plain() local
257 ssize_t bytes_written = swrite(sockfd, mem, len); in Curl_send_plain()
294 curl_socket_t sockfd, in Curl_write_plain() argument
301 int num = (sockfd == conn->sock[SECONDARYSOCKET]); in Curl_write_plain()
313 curl_socket_t sockfd = conn->sock[num]; in Curl_recv_plain() local
314 ssize_t nread = sread(sockfd, buf, len); in Curl_recv_plain()
[all …]
Dmemdebug.h61 CURL_EXTERN void curl_mark_sclose(curl_socket_t sockfd,
63 CURL_EXTERN int curl_sclose(curl_socket_t sockfd,
145 #define sclose(sockfd) curl_sclose(sockfd,__LINE__,__FILE__) argument
147 #define fake_sclose(sockfd) curl_mark_sclose(sockfd,__LINE__,__FILE__) argument
Dgopher.c79 curl_socket_t sockfd = conn->sock[FIRSTSOCKET]; in gopher_do() local
119 result = Curl_write(conn, sockfd, sel, k, &amount); in gopher_do()
145 Curl_socket_ready(CURL_SOCKET_BAD, sockfd, 100); in gopher_do()
152 result = Curl_sendf(sockfd, conn, "\r\n"); in gopher_do()
/external/iptables/extensions/
Dlibxt_set.h19 int res, sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); in get_version() local
23 if (sockfd < 0) in get_version()
27 if (fcntl(sockfd, F_SETFD, FD_CLOEXEC) == -1) { in get_version()
34 res = getsockopt(sockfd, SOL_IP, SO_IP_SET, &req_version, &size); in get_version()
41 return sockfd; in get_version()
49 int res, sockfd; in get_set_byid() local
51 sockfd = get_version(&req.version); in get_set_byid()
54 res = getsockopt(sockfd, SOL_IP, SO_IP_SET, &req, &size); in get_set_byid()
55 close(sockfd); in get_set_byid()
78 int res, sockfd; in get_set_byname() local
[all …]
/external/curl/docs/examples/
Dsendrecv.c29 static int wait_on_socket(curl_socket_t sockfd, int for_recv, long timeout_ms) in wait_on_socket() argument
42 FD_SET(sockfd, &errfd); /* always check for error */ in wait_on_socket()
46 FD_SET(sockfd, &infd); in wait_on_socket()
50 FD_SET(sockfd, &outfd); in wait_on_socket()
54 res = select(sockfd + 1, &infd, &outfd, &errfd, &tv); in wait_on_socket()
64 curl_socket_t sockfd; /* socket */ in main() local
94 sockfd = sockextr; in main()
97 if(!wait_on_socket(sockfd, 0, 60000L)) in main()
120 wait_on_socket(sockfd, 1, 60000L); in main()
Dexternalsocket.c64 curl_socket_t sockfd; in opensocket() local
67 sockfd = *(curl_socket_t *)clientp; in opensocket()
70 return sockfd; in opensocket()
88 curl_socket_t sockfd; in main() local
109 if( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) == CURL_SOCKET_BAD ) { in main()
121 if(connect(sockfd,(struct sockaddr *) &servaddr, sizeof(servaddr)) == in main()
123 close(sockfd); in main()
136 curl_easy_setopt(curl, CURLOPT_OPENSOCKETDATA, &sockfd); in main()
Dmulti-uv.c48 curl_socket_t sockfd; member
51 curl_context_t* create_curl_context(curl_socket_t sockfd) in create_curl_context() argument
57 context->sockfd = sockfd; in create_curl_context()
59 uv_poll_init_socket(loop, &context->poll_handle, sockfd); in create_curl_context()
147 curl_multi_socket_action(curl_handle, context->sockfd, flags, in curl_perform()
Dhiperfifo.c98 curl_socket_t sockfd; member
234 f->sockfd = s; in setsock()
239 f->ev = event_new(g->evbase, f->sockfd, kind, event_cb, g); in setsock()
370 curl_socket_t sockfd; in init_fifo() local
385 sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0); in init_fifo()
386 if (sockfd == -1) { in init_fifo()
390 g->input = fdopen(sockfd, "r"); in init_fifo()
393 g->fifo_event = event_new(g->evbase, sockfd, EV_READ|EV_PERSIST, fifo_cb, g); in init_fifo()
/external/toybox/toys/other/
Dnetcat.c95 int sockfd=-1, pollcount=2; in netcat_main() local
114 sockfd = xsocket(AF_INET, SOCK_STREAM, 0); in netcat_main()
115 fcntl(sockfd, F_SETFD, FD_CLOEXEC); in netcat_main()
117 setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &temp, sizeof(temp)); in netcat_main()
124 if (bind(sockfd, (struct sockaddr *)&address, sizeof(address))) in netcat_main()
134 temp = connect(sockfd, (struct sockaddr *)&address, sizeof(address)); in netcat_main()
136 pollfds[0].fd = sockfd; in netcat_main()
143 if (listen(sockfd, 5)) error_exit("listen"); in netcat_main()
145 getsockname(sockfd, (struct sockaddr *)&address, &len); in netcat_main()
163 pollfds[0].fd = accept(sockfd, (struct sockaddr *)&address, &len); in netcat_main()
[all …]
Difconfig.c56 int sockfd; in GLOBALS() argument
113 if (ioctl(TT.sockfd, SIOCGIFFLAGS, &ifre)<0) perror_exit_raw(name); in display_ifconfig()
118 i = ioctl(TT.sockfd, SIOCGIFHWADDR, &ifre); in display_ifconfig()
134 ioctl(TT.sockfd, SIOCGIFADDR, &ifre); in display_ifconfig()
155 if (addr[i].ioctl && ioctl(TT.sockfd, addr[i].ioctl, &ifre)) in display_ifconfig()
222 if (ioctl(TT.sockfd, SIOCGIFMTU, &ifre) < 0) ifre.ifr_mtu = 0; in display_ifconfig()
224 if (ioctl(TT.sockfd, SIOCGIFMETRIC, &ifre) < 0) ifre.ifr_metric = 0; in display_ifconfig()
239 if (ioctl(TT.sockfd, SIOCGIFTXQLEN, &ifre) >= 0) val[16] = ifre.ifr_qlen; in display_ifconfig()
251 if(!ioctl(TT.sockfd, SIOCGIFMAP, &ifre) && (ifre.ifr_map.irq || in display_ifconfig()
317 xioctl(TT.sockfd, SIOCGIFCONF, &ifcon); in show_iface()
[all …]
/external/toybox/toys/pending/
Dbrctl.c39 int sockfd; in GLOBALS() argument
54 xioctl(TT.sockfd, SIOCDEVPRIVATE, &ifr);
68 if (ioctl(TT.sockfd, SIOCDEVPRIVATE, &ifr) < 0) { in get_br_info()
82 num = ioctl(TT.sockfd, SIOCGIFBR, args); //ret is num of bridges found in br_show()
119 xioctl(TT.sockfd, SIOCBRADDBR, argv[0]); in br_addbr()
122 xioctl(TT.sockfd, SIOCSIFBR, args); in br_addbr()
132 xioctl(TT.sockfd, SIOCBRDELBR, argv[0]); in br_delbr()
135 xioctl(TT.sockfd, SIOCSIFBR, args); in br_delbr()
148 xioctl(TT.sockfd, SIOCBRADDIF, &ifr); in br_addif()
153 xioctl(TT.sockfd, SIOCDEVPRIVATE, &ifr); in br_addif()
[all …]
Ddhcp.c178 int sockfd; member
581 if (state->sockfd > 0) close(state->sockfd); in mode_raw()
584 state->sockfd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP)); in mode_raw()
585 if (state->sockfd < 0) { in mode_raw()
586 dbg("MODE RAW : socket fail ERROR : %d\n", state->sockfd); in mode_raw()
589 dbg("Got raw socket fd %d\n", state->sockfd); in mode_raw()
595 if (bind(state->sockfd, (struct sockaddr *) &sock, sizeof(sock))) { in mode_raw()
597 close(state->sockfd); in mode_raw()
601 …if (setsockopt(state->sockfd, SOL_SOCKET, SO_ATTACH_FILTER, &filter_prog, sizeof(filter_prog)) < 0) in mode_raw()
615 if (state->sockfd > 0) close(state->sockfd); in mode_app()
[all …]
/external/ppp/pppd/plugins/radius/
Dsendserver.c194 int sockfd; in rc_send_server() local
235 sockfd = socket (AF_INET, SOCK_DGRAM, 0); in rc_send_server()
236 if (sockfd < 0) in rc_send_server()
249 if (bind (sockfd, (struct sockaddr *) sin, length) < 0 || in rc_send_server()
250 getsockname (sockfd, (struct sockaddr *) sin, &length) < 0) in rc_send_server()
252 close (sockfd); in rc_send_server()
296 sendto (sockfd, (char *) auth, (unsigned int) total_length, (int) 0, in rc_send_server()
302 FD_SET (sockfd, &readfds); in rc_send_server()
303 if (select (sockfd + 1, &readfds, NULL, NULL, &authtime) < 0) in rc_send_server()
309 close (sockfd); in rc_send_server()
[all …]
/external/iproute2/tc/
Dem_ipset.c74 int res, sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); in get_version() local
78 if (sockfd < 0) { in get_version()
84 res = getsockopt(sockfd, SOL_IP, SO_IP_SET, &req_version, &size); in get_version()
91 return sockfd; in get_version()
96 int sockfd, res; in do_getsockopt() local
98 sockfd = get_version(&req->version); in do_getsockopt()
99 if (sockfd < 0) in do_getsockopt()
101 res = getsockopt(sockfd, SOL_IP, SO_IP_SET, req, &size); in do_getsockopt()
104 close(sockfd); in do_getsockopt()
/external/mdnsresponder/mDNSPosix/
DmDNSUNP.c95 int sockfd = -1; in get_ifi_info_linuxv6() local
104 sockfd = socket(AF_INET6, SOCK_DGRAM, 0); in get_ifi_info_linuxv6()
105 if (sockfd < 0) { in get_ifi_info_linuxv6()
174 if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) { in get_ifi_info_linuxv6()
207 if (sockfd != -1) { in get_ifi_info_linuxv6()
209 int sockfd_closed = close(sockfd); in get_ifi_info_linuxv6()
225 int sockfd, sockf6, len, lastlen, flags, myflags; in get_ifi_info() local
242 sockfd = -1; in get_ifi_info()
247 sockfd = socket(AF_INET, SOCK_DGRAM, 0); in get_ifi_info()
248 if (sockfd < 0) { in get_ifi_info()
[all …]
/external/nanopb-c/examples/network_server/
Dclient.c90 int sockfd; in main() local
97 sockfd = socket(AF_INET, SOCK_STREAM, 0); in main()
104 if (connect(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) != 0) in main()
110 if (!listdir(sockfd, path)) in main()
113 close(sockfd); in main()
/external/curl/tests/server/
Dsockfilt.c893 curl_socket_t sockfd = CURL_SOCKET_BAD; in juggle() local
934 sockfd = listenfd; in juggle()
936 FD_SET(sockfd, &fds_read); in juggle()
937 maxfd = (int)sockfd; in juggle()
942 sockfd = *sockfdp; in juggle()
943 if(CURL_SOCKET_BAD == sockfd) { in juggle()
950 FD_SET(sockfd, &fds_read); in juggle()
952 FD_SET(sockfd, &fds_err); in juggle()
954 maxfd = (int)sockfd; in juggle()
960 sockfd = *sockfdp; in juggle()
[all …]
/external/autotest/client/site_tests/platform_CompressedSwapPerf/src/
Dhog.c89 int sockfd; in main() local
108 sockfd = socket(AF_UNIX, SOCK_STREAM, 0); in main()
110 if (sockfd < 0) { in main()
127 if (bind(sockfd, (struct sockaddr *)&test_sock_addr, sizeof test_sock_addr)) { in main()
132 if (listen(sockfd, 1)) { in main()
138 if ((connfd = accept(sockfd, NULL, NULL)) < 0) { in main()
/external/mdnsresponder/mDNSShared/
Ddnssd_clientstub.c120 #define DNSServiceRefValid(X) (dnssd_SocketValid((X)->sockfd) && (((X)->sockfd ^ (X)->validator) ==…
132 dnssd_sock_t sockfd; // Connected socket between client and daemon member
387 if ((x->sockfd ^ x->validator) != ValidatorBits) in FreeDNSServiceOp()
388 …ssd_clientstub attempt to dispose invalid DNSServiceRef %p %08X %08X", x, x->sockfd, x->validator); in FreeDNSServiceOp()
393 x->sockfd = dnssd_InvalidSocket; in FreeDNSServiceOp()
439 (*ref), (*ref)->sockfd, (*ref)->validator); in ConnectToServer()
460 sdr->sockfd = dnssd_InvalidSocket; in ConnectToServer()
461 sdr->validator = sdr->sockfd ^ ValidatorBits; in ConnectToServer()
485 sdr->sockfd = (*ref)->sockfd; // Inherit primary's socket in ConnectToServer()
496 sdr->sockfd = socket(AF_DNSSD, SOCK_STREAM, 0); in ConnectToServer()
[all …]

1234