Home
last modified time | relevance | path

Searched refs:sock (Results 1 – 25 of 598) sorted by relevance

12345678910>>...24

/third_party/lwip/src/api/
Dsockets.c127 #define SOCK_ADDR_TYPE_MATCH(name, sock) \ argument
128 ((((name)->sa_family == AF_INET) && !(NETCONNTYPE_ISIPV6((sock)->conn->type))) || \
129 (((name)->sa_family == AF_INET6) && (NETCONNTYPE_ISIPV6((sock)->conn->type))))
142 #define SOCK_ADDR_TYPE_MATCH(name, sock) 1 argument
151 #define SOCK_ADDR_TYPE_MATCH(name, sock) 1 argument
161 #define SOCK_ADDR_TYPE_MATCH_OR_UNSPEC(name, sock) (((name)->sa_family == AF_UNSPEC) || \ argument
162 SOCK_ADDR_TYPE_MATCH(name, sock))
166 #define LWIP_SOCKOPT_CHECK_OPTLEN(sock, optlen, opttype) do { if ((optlen) < sizeof(opttype)) { don… argument
167 #define LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, opttype) do { \ argument
168 LWIP_SOCKOPT_CHECK_OPTLEN(sock, optlen, opttype); \
[all …]
/third_party/python/Lib/test/
Dtest_timeout.py32 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
35 self.sock.close()
39 self.assertEqual(self.sock.gettimeout(), None,
44 self.sock.settimeout(7.345)
45 self.assertEqual(self.sock.gettimeout(), 7.345)
47 self.sock.settimeout(3)
48 self.assertEqual(self.sock.gettimeout(), 3)
50 self.sock.settimeout(None)
51 self.assertEqual(self.sock.gettimeout(), None)
55 self.sock.settimeout(1)
[all …]
Dtest_httplib.py155 conn.sock = FakeSocket('blahblahblah')
183 conn.sock = FakeSocket(None)
199 conn.sock = FakeSocket(None)
212 conn.sock = FakeSocket(None)
223 conn.sock = FakeSocket(None)
233 conn.sock = FakeSocket(None)
271 sock = FakeSocket('')
272 conn.sock = sock
274 self.assertTrue(sock.data.startswith(expected))
279 sock = FakeSocket('')
[all …]
/third_party/python/Lib/test/test_asyncio/
Dtest_sock_lowlevel.py72 def _basetest_sock_client_ops(self, httpd, sock): argument
77 sock.setblocking(True)
80 self.loop.sock_connect(sock, httpd.address))
83 self.loop.sock_sendall(sock, b'GET / HTTP/1.0\r\n\r\n'))
86 self.loop.sock_recv(sock, 1024))
89 self.loop.sock_recv_into(sock, bytearray()))
92 self.loop.sock_accept(sock))
95 sock.setblocking(False)
97 self.loop.sock_connect(sock, httpd.address))
99 self.loop.sock_sendall(sock, b'GET / HTTP/1.0\r\n\r\n'))
[all …]
/third_party/vk-gl-cts/framework/delibs/deutil/
DdeSocket.c412 deSocket* sock = (deSocket*)deCalloc(sizeof(deSocket)); in deSocket_create() local
413 if (!sock) in deSocket_create()
414 return sock; in deSocket_create()
422 sock->stateLock = deMutex_create(0); in deSocket_create()
423 sock->handle = DE_INVALID_SOCKET_HANDLE; in deSocket_create()
424 sock->state = DE_SOCKETSTATE_CLOSED; in deSocket_create()
426 return sock; in deSocket_create()
429 void deSocket_destroy (deSocket* sock) in deSocket_destroy() argument
431 if (sock->state != DE_SOCKETSTATE_CLOSED) in deSocket_destroy()
432 deSocket_close(sock); in deSocket_destroy()
[all …]
/third_party/libsoup/libsoup/
Dsoup-socket.c110 static void finish_socket_setup (SoupSocket *sock);
111 static void finish_listener_setup (SoupSocket *sock);
114 soup_socket_init (SoupSocket *sock) in soup_socket_init() argument
116 SoupSocketPrivate *priv = soup_socket_get_instance_private (sock); in soup_socket_init()
129 SoupSocket *sock = SOUP_SOCKET (initable); in soup_socket_initable_init() local
130 SoupSocketPrivate *priv = soup_socket_get_instance_private (sock); in soup_socket_initable_init()
136 finish_socket_setup (sock); in soup_socket_initable_init()
170 finish_socket_setup (sock); in soup_socket_initable_init()
172 finish_listener_setup (sock); in soup_socket_initable_init()
184 disconnect_internal (SoupSocket *sock, gboolean close) in disconnect_internal() argument
[all …]
Dsoup-socket.h29 void (*readable) (SoupSocket *sock);
30 void (*writable) (SoupSocket *sock);
31 void (*disconnected) (SoupSocket *sock);
56 typedef void (*SoupSocketCallback) (SoupSocket *sock,
68 void soup_socket_connect_async (SoupSocket *sock,
73 guint soup_socket_connect_sync (SoupSocket *sock,
76 int soup_socket_get_fd (SoupSocket *sock);
79 gboolean soup_socket_listen (SoupSocket *sock);
82 gboolean soup_socket_start_ssl (SoupSocket *sock,
85 gboolean soup_socket_start_proxy_ssl (SoupSocket *sock,
[all …]
/third_party/openssl/crypto/bio/
Db_sock2.c42 int sock = -1; in BIO_socket() local
47 sock = socket(domain, socktype, protocol); in BIO_socket()
48 if (sock == -1) { in BIO_socket()
54 return sock; in BIO_socket()
77 int BIO_connect(int sock, const BIO_ADDR *addr, int options) in BIO_connect() argument
81 if (sock == -1) { in BIO_connect()
86 if (!BIO_socket_nbio(sock, (options & BIO_SOCK_NONBLOCK) != 0)) in BIO_connect()
90 if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, in BIO_connect()
99 if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, in BIO_connect()
107 if (connect(sock, BIO_ADDR_sockaddr(addr), in BIO_connect()
[all …]
/third_party/lwip/src/core/distributed_net/
Ddistributed_net_core.c39 int distributed_net_connect(int sock, const struct sockaddr *addr, socklen_t addr_len) in distributed_net_connect() argument
41 CHECK_PARA(SOCKET_TO_INDEX(sock) >= 0 && SOCKET_TO_INDEX(sock) < NUM_SOCKETS, EBADF); in distributed_net_connect()
49 return lwip_connect_internal(sock, addr, addr_len); in distributed_net_connect()
54 if (lwip_connect_internal(sock, (struct sockaddr *)&addr_in, sizeof(addr_in)) < 0) { in distributed_net_connect()
59 set_distributed_net_socket(sock); in distributed_net_connect()
69 if (lwip_send(sock, &data, sizeof(data), 0) < 0) { in distributed_net_connect()
70 reset_distributed_net_socket(sock); in distributed_net_connect()
76 int distributed_net_close(int sock) in distributed_net_close() argument
78 CHECK_PARA(SOCKET_TO_INDEX(sock) >= 0 && SOCKET_TO_INDEX(sock) < NUM_SOCKETS, EBADF); in distributed_net_close()
80 reset_distributed_net_socket(sock); in distributed_net_close()
[all …]
/third_party/libcoap/src/
Dcoap_tcp.c39 coap_socket_connect_tcp1(coap_socket_t *sock, argument
55 sock->flags &= ~COAP_SOCKET_CONNECTED;
56 sock->fd = socket(server->addr.sa.sa_family, SOCK_STREAM, 0);
58 if (sock->fd == COAP_INVALID_SOCKET) {
67 if (ioctlsocket(sock->fd, FIONBIO, &u_on) == COAP_SOCKET_ERROR) {
69 if (ioctl(sock->fd, FIONBIO, &on) == COAP_SOCKET_ERROR) {
87 …if (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_V6ONLY, OPTVAL_T(&off), sizeof(off)) == COAP_SOCKET_ER…
100 …if (setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, OPTVAL_T(&on), sizeof(on)) == COAP_SOCKET_ERROR)
104 if (bind(sock->fd, &local_if->addr.sa,
116 if (connect(sock->fd, &connect_addr.addr.sa, connect_addr.size) == COAP_SOCKET_ERROR) {
[all …]
Dcoap_io.c103 coap_socket_bind_udp(coap_socket_t *sock, in coap_socket_bind_udp() argument
106 sock->conn = udp_new(NULL, 0, NULL); in coap_socket_bind_udp()
108 if (!sock->conn) { in coap_socket_bind_udp()
116 udp_bind((struct uip_udp_conn *)sock->conn, bound_addr->port); in coap_socket_bind_udp()
121 coap_socket_connect_udp(coap_socket_t *sock, in coap_socket_connect_udp() argument
131 coap_socket_write(coap_socket_t *sock, const uint8_t *data, size_t data_len) { in coap_socket_write() argument
136 coap_socket_read(coap_socket_t *sock, uint8_t *data, size_t data_len) { in coap_socket_read() argument
140 void coap_socket_close(coap_socket_t *sock) { in coap_socket_close() argument
141 if (sock->conn) in coap_socket_close()
142 uip_udp_remove((struct uip_udp_conn *)sock->conn); in coap_socket_close()
[all …]
Dcoap_io_riot.c44 coap_network_send(coap_socket_t *sock, in coap_network_send() argument
52 } else if (sock->flags & COAP_SOCKET_CONNECTED) { in coap_network_send()
53 bytes_written = send(sock->fd, data, datalen, 0); in coap_network_send()
55 bytes_written = sendto(sock->fd, data, datalen, 0, in coap_network_send()
73 coap_network_read(coap_socket_t *sock, coap_packet_t *packet) { in coap_network_read() argument
81 assert(sock); in coap_network_read()
84 if ((sock->flags & COAP_SOCKET_CAN_READ) == 0) { in coap_network_read()
89 sock->flags &= ~COAP_SOCKET_CAN_READ; in coap_network_read()
94 udp = gnrc_pktsnip_search_type(sock->pkt, type); in coap_network_read()
95 ipv6_hdr = gnrc_ipv6_get_header(sock->pkt); in coap_network_read()
[all …]
/third_party/wpa_supplicant/wpa_supplicant-2.9/wpa_supplicant/
Dctrl_iface_unix.c36 int sock; member
46 int sock; member
64 const char *ifname, int sock,
76 static void wpas_ctrl_sock_debug(const char *title, int sock, const char *buf, in wpas_ctrl_sock_debug() argument
89 if (getsockopt(sock, SOL_SOCKET, SO_SNDBUF, &sndbuf, &optlen) < 0) in wpas_ctrl_sock_debug()
92 if (ioctl(sock, TIOCOUTQ, &outq) < 0) in wpas_ctrl_sock_debug()
97 title, sock, sndbuf, outq, (int) len); in wpas_ctrl_sock_debug()
129 static void wpa_supplicant_ctrl_iface_receive(int sock, void *eloop_ctx, in wpa_supplicant_ctrl_iface_receive() argument
142 res = recvfrom(sock, buf, sizeof(buf) - 1, 0, in wpa_supplicant_ctrl_iface_receive()
193 wpas_ctrl_sock_debug("ctrl_sock-sendto", sock, reply, in wpa_supplicant_ctrl_iface_receive()
[all …]
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/wpa_supplicant/
Dctrl_iface_unix.c36 int sock; member
46 int sock; member
64 const char *ifname, int sock,
76 static void wpas_ctrl_sock_debug(const char *title, int sock, const char *buf, in wpas_ctrl_sock_debug() argument
89 if (getsockopt(sock, SOL_SOCKET, SO_SNDBUF, &sndbuf, &optlen) < 0) in wpas_ctrl_sock_debug()
92 if (ioctl(sock, TIOCOUTQ, &outq) < 0) in wpas_ctrl_sock_debug()
97 title, sock, sndbuf, outq, (int) len); in wpas_ctrl_sock_debug()
129 static void wpa_supplicant_ctrl_iface_receive(int sock, void *eloop_ctx, in wpa_supplicant_ctrl_iface_receive() argument
145 res = recvfrom(sock, buf, CTRL_IFACE_MAX_LEN + 1, 0, in wpa_supplicant_ctrl_iface_receive()
202 wpas_ctrl_sock_debug("ctrl_sock-sendto", sock, reply, in wpa_supplicant_ctrl_iface_receive()
[all …]
/third_party/node/test/parallel/
Dtest-socket-write-after-fin-error.js17 const server = net.createServer(function(sock) { argument
18 sock.setEncoding('utf8');
19 sock.on('error', function(er) {
24 sock.on('data', function(c) {
27 sock.on('end', function() {
29 sock.write(serverData);
30 sock.end();
35 const sock = net.connect(this.address().port);
36 sock.setEncoding('utf8');
37 sock.on('data', function(c) {
[all …]
Dtest-socket-write-after-fin.js9 }, common.mustCall(function(sock) { argument
12 sock.setEncoding('utf8');
13 sock.on('data', function(c) {
16 sock.on('end', common.mustCall(function() {
18 sock.end(serverData);
23 const sock = net.connect(this.address().port);
26 sock.setEncoding('utf8');
27 sock.on('data', function(c) {
31 sock.on('end', common.mustCall(function() {
35 sock.write('hello1');
[all …]
Dtest-dgram-send-bad-arguments.js29 const sock = dgram.createSocket('udp4'); constant
34 () => { sock.send(); },
46 () => { sock.send(buf, 1, 1, -1, host); },
55 () => { sock.send(buf, 1, 1, 0, host); },
64 () => { sock.send(buf, 1, 1, 65536, host); },
73 () => { sock.send(buf, 1234, '127.0.0.1', common.mustNotCall()); },
81 assert.throws(() => { sock.send(buf, 1, 1, -1, host); }, RangeError);
82 assert.throws(() => { sock.send(buf, 1, 1, 0, host); }, RangeError);
83 assert.throws(() => { sock.send(buf, 1, 1, 65536, host); }, RangeError);
88 () => { sock.send(23, 12345, host); },
[all …]
/third_party/libnl/tests/
Dtest-complex-HTB-with-hash-filters.c140 static int u32_add_filter_on_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio, in u32_add_filter_on_ht() argument
154 nl_socket_free(sock); in u32_add_filter_on_ht()
178 if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) { in u32_add_filter_on_ht()
192 static int u32_add_filter_on_ht_with_hashmask(struct nl_sock *sock, struct rtnl_link *rtnlLink, uin… in u32_add_filter_on_ht_with_hashmask() argument
206 nl_socket_free(sock); in u32_add_filter_on_ht_with_hashmask()
232 if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) { in u32_add_filter_on_ht_with_hashmask()
243 static int u32_add_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio, uint32_t hti… in u32_add_ht() argument
252 nl_socket_free(sock); in u32_add_ht()
271 if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) { in u32_add_ht()
282 static int qdisc_add_HTB(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t defaultClass) in qdisc_add_HTB() argument
[all …]
Dtest-u32-filter-with-actions.c106 int u32_add_filter_on_ht_with_hashmask(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t p… in u32_add_filter_on_ht_with_hashmask() argument
116 nl_socket_free(sock); in u32_add_filter_on_ht_with_hashmask()
146 if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) { in u32_add_filter_on_ht_with_hashmask()
158 int u32_add_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio, uint32_t htid, uint… in u32_add_ht() argument
167 nl_socket_free(sock); in u32_add_ht()
186 if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) { in u32_add_ht()
198 int qdisc_add_ingress(struct nl_sock *sock, struct rtnl_link *rtnlLink) in qdisc_add_ingress() argument
215 rtnl_qdisc_delete(sock, qdisc); in qdisc_add_ingress()
226 if ((err = rtnl_qdisc_add(sock, qdisc, NLM_F_CREATE))) { in qdisc_add_ingress()
239 struct nl_sock *sock; in main() local
[all …]
/third_party/grpc/test/core/iomgr/
Dsocket_utils_test.cc82 int sock; in main() local
86 sock = socket(PF_INET, SOCK_STREAM, 0); in main()
87 GPR_ASSERT(sock > 0); in main()
90 grpc_set_socket_nonblocking(sock, 1))); in main()
92 grpc_set_socket_nonblocking(sock, 0))); in main()
94 grpc_set_socket_cloexec(sock, 1))); in main()
96 grpc_set_socket_cloexec(sock, 0))); in main()
98 grpc_set_socket_reuse_addr(sock, 1))); in main()
100 grpc_set_socket_reuse_addr(sock, 0))); in main()
102 grpc_set_socket_low_latency(sock, 1))); in main()
[all …]
/third_party/libuv/test/
Dtest-poll.c60 uv_os_sock_t sock; member
70 uv_os_sock_t sock; member
104 uv_os_sock_t sock; in create_bound_socket() local
107 sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); in create_bound_socket()
109 ASSERT(sock != INVALID_SOCKET); in create_bound_socket()
111 ASSERT(sock >= 0); in create_bound_socket()
118 r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes); in create_bound_socket()
123 r = bind(sock, (const struct sockaddr*) &bind_addr, sizeof bind_addr); in create_bound_socket()
126 return sock; in create_bound_socket()
130 static void close_socket(uv_os_sock_t sock) { in close_socket() argument
[all …]
/third_party/libsoup/tests/
Dsocket-test.c21 SoupSocket *sock; in do_unconnected_socket_test() local
39 sock = soup_socket_new (SOUP_SOCKET_LOCAL_ADDRESS, localhost, in do_unconnected_socket_test()
41 g_assert_true (sock != NULL); in do_unconnected_socket_test()
43 addr = soup_socket_get_local_address (sock); in do_unconnected_socket_test()
51 addr = soup_socket_get_remote_address (sock); in do_unconnected_socket_test()
55 res = soup_socket_listen (sock); in do_unconnected_socket_test()
58 addr = soup_socket_get_local_address (sock); in do_unconnected_socket_test()
64 soup_socket_get_local_address (sock), in do_unconnected_socket_test()
77 soup_socket_get_local_address (sock), in do_unconnected_socket_test()
87 addr = soup_socket_get_remote_address (sock); in do_unconnected_socket_test()
[all …]
/third_party/python/Lib/test/support/
Dsocket_helper.py76 def bind_port(sock, host=HOST): argument
91 if sock.family == socket.AF_INET and sock.type == socket.SOCK_STREAM:
93 if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1:
99 if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
109 sock.setsockopt(socket.SOL_SOCKET, socket.SO_EXCLUSIVEADDRUSE, 1)
111 sock.bind((host, 0))
112 port = sock.getsockname()[1]
115 def bind_unix_socket(sock, addr): argument
117 assert sock.family == socket.AF_UNIX
119 sock.bind(addr)
[all …]
/third_party/ltp/testcases/kernel/syscalls/send/
Dsend02.c25 static int sock = -1, dst_sock = -1, listen_sock = -1; variable
29 static void do_send(int sock, void *buf, size_t size, int flags) in do_send() argument
31 SAFE_SEND(1, sock, buf, size, flags); in do_send()
34 static void do_sendto(int sock, void *buf, size_t size, int flags) in do_sendto() argument
36 SAFE_SENDTO(1, sock, buf, size, flags, (struct sockaddr *)&addr, in do_sendto()
40 static void do_sendmsg(int sock, void *buf, size_t size, int flags) in do_sendmsg() argument
54 SAFE_SENDMSG(size, sock, &msg, flags); in do_sendmsg()
59 void (*send)(int sock, void *buf, size_t size, int flags);
74 static int check_recv(int sock, long expsize, int loop) in check_recv() argument
79 TEST(recv(sock, recvbuf, RECVSIZE, MSG_DONTWAIT)); in check_recv()
[all …]
/third_party/ltp/testcases/kernel/syscalls/bind/
Dbind05.c87 int sock; in peer_thread() local
91 sock = SAFE_SOCKET(tc->address->sa_family, tc->type, tc->protocol); in peer_thread()
98 SAFE_BIND(sock, (struct sockaddr *)&peer_addr, in peer_thread()
101 SAFE_CONNECT(sock, tc->address, tc->addrlen); in peer_thread()
102 SAFE_WRITE(1, sock, &request, sizeof(request)); in peer_thread()
103 SAFE_READ(1, sock, &request, sizeof(request)); in peer_thread()
110 SAFE_WRITE(1, sock, response, strlen(response) + 1); in peer_thread()
111 SAFE_CLOSE(sock); in peer_thread()
125 int sock, size; in test_bind() local
132 sock = SAFE_SOCKET(tc->address->sa_family, tc->type, tc->protocol); in test_bind()
[all …]

12345678910>>...24