Home
last modified time | relevance | path

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

12345678910>>...27

/external/python/cpython2/Lib/test/
Dtest_timeout.py17 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
20 self.sock.close()
24 self.assertEqual(self.sock.gettimeout(), None,
29 self.sock.settimeout(7.345)
30 self.assertEqual(self.sock.gettimeout(), 7.345)
32 self.sock.settimeout(3)
33 self.assertEqual(self.sock.gettimeout(), 3)
35 self.sock.settimeout(None)
36 self.assertEqual(self.sock.gettimeout(), None)
40 self.sock.settimeout(1)
[all …]
Dtest_httplib.py105 conn.sock = FakeSocket('blahblahblah')
133 conn.sock = FakeSocket(None)
149 conn.sock = FakeSocket(None)
162 conn.sock = FakeSocket(None)
173 conn.sock = FakeSocket(None)
183 conn.sock = FakeSocket(None)
221 sock = FakeSocket('')
222 conn.sock = sock
224 self.assertTrue(sock.data.startswith(expected))
229 sock = FakeSocket('')
[all …]
/external/python/cpython3/Lib/test/
Dtest_timeout.py31 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
34 self.sock.close()
38 self.assertEqual(self.sock.gettimeout(), None,
43 self.sock.settimeout(7.345)
44 self.assertEqual(self.sock.gettimeout(), 7.345)
46 self.sock.settimeout(3)
47 self.assertEqual(self.sock.gettimeout(), 3)
49 self.sock.settimeout(None)
50 self.assertEqual(self.sock.gettimeout(), None)
54 self.sock.settimeout(1)
[all …]
Dtest_httplib.py148 conn.sock = FakeSocket('blahblahblah')
176 conn.sock = FakeSocket(None)
192 conn.sock = FakeSocket(None)
205 conn.sock = FakeSocket(None)
216 conn.sock = FakeSocket(None)
226 conn.sock = FakeSocket(None)
264 sock = FakeSocket('')
265 conn.sock = sock
267 self.assertTrue(sock.data.startswith(expected))
272 sock = FakeSocket('')
[all …]
/external/deqp/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 …]
/external/python/cpython3/Lib/test/test_asyncio/
Dtest_selector_events.py189 sock = test_utils.mock_nonblocking_socket()
192 f = self.loop.create_task(self.loop.sock_recv(sock, 1024))
196 (None, sock, 1024))
203 sock = mock.Mock()
204 sock.fileno.return_value = 10
205 sock.recv.side_effect = BlockingIOError
206 sock.gettimeout.return_value = 0.0
211 self.loop.sock_recv(sock, 1024))
220 sock.fileno.return_value = -1
221 sock.recv.side_effect = OSError(9)
[all …]
Dtest_server.py20 def client(sock, addr): argument
28 sock.settimeout(2)
29 sock.connect(addr)
30 sock.send(HELLO_MSG)
31 sock.recv_all(1)
32 sock.close()
54 with self.tcp_client(lambda sock: client(sock, addr)):
77 def client(sock, addr): argument
78 sock.settimeout(2)
80 sock.connect(addr)
[all …]
/external/wpa_supplicant_8/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 …]
Dctrl_iface_udp.c46 int sock; member
52 int sock; member
59 const char *ifname, int sock,
217 static void wpa_supplicant_ctrl_iface_receive(int sock, void *eloop_ctx, argument
238 res = recvfrom(sock, buf, sizeof(buf) - 1, 0,
331 sendto(sock, reply, reply_len, 0, (struct sockaddr *) &from,
335 sendto(sock, "FAIL\n", 5, 0, (struct sockaddr *) &from,
338 sendto(sock, "OK\n", 3, 0, (struct sockaddr *) &from,
364 priv->sock, &priv->ctrl_dst, level, txt, len);
371 wpa_supplicant_ctrl_iface_send(wpa_s, NULL, wpa_s->ctrl_iface->sock,
[all …]
/external/mdnsresponder/mDNSWindows/
DmDNSWin32.c142 mDNSlocal void TCPCanRead( TCPSocket * sock );
143 mDNSlocal mStatus TCPBeginRecv( TCPSocket * sock );
146 mDNSlocal void CALLBACK TCPFreeSocket( TCPSocket *sock );
149 mDNSlocal void UDPCloseSocket( UDPSocket * sock );
150 mDNSlocal void CALLBACK UDPFreeSocket( UDPSocket * sock );
164 mDNSlocal void DispatchUDPEvent( mDNS * const m, UDPSocket * sock );
165 mDNSlocal void DispatchTCPEvent( mDNS * const m, TCPSocket * sock );
965 TCPSocket * sock = NULL; in mDNSPlatformTCPSocket() local
977 sock = (TCPSocket *) malloc( sizeof( TCPSocket ) ); in mDNSPlatformTCPSocket()
978 require_action( sock, exit, err = mStatus_NoMemoryErr ); in mDNSPlatformTCPSocket()
[all …]
/external/libnl/tests/
Dtest-complex-HTB-with-hash-filters.c137 int u32_add_filter_on_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio, in u32_add_filter_on_ht() argument
151 nl_socket_free(sock); in u32_add_filter_on_ht()
175 if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) { in u32_add_filter_on_ht()
189 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
203 nl_socket_free(sock); in u32_add_filter_on_ht_with_hashmask()
229 if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) { in u32_add_filter_on_ht_with_hashmask()
240 int u32_add_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio, uint32_t htid, uint… in u32_add_ht() argument
249 nl_socket_free(sock); in u32_add_ht()
268 if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) { in u32_add_ht()
279 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.c102 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
112 nl_socket_free(sock); in u32_add_filter_on_ht_with_hashmask()
140 if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) { in u32_add_filter_on_ht_with_hashmask()
152 int u32_add_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio, uint32_t htid, uint… in u32_add_ht() argument
161 nl_socket_free(sock); in u32_add_ht()
180 if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) { in u32_add_ht()
192 int qdisc_add_ingress(struct nl_sock *sock, struct rtnl_link *rtnlLink) in qdisc_add_ingress() argument
209 rtnl_qdisc_delete(sock, qdisc); in qdisc_add_ingress()
220 if ((err = rtnl_qdisc_add(sock, qdisc, NLM_F_CREATE))) { in qdisc_add_ingress()
233 struct nl_sock *sock; in main() local
[all …]
/external/autotest/client/profilers/powertop/src/
Dethernet.c54 int sock; in activate_WOL_suggestion() local
61 sock = socket(AF_INET, SOCK_DGRAM, 0); in activate_WOL_suggestion()
62 if (sock<0) in activate_WOL_suggestion()
68 ret = ioctl(sock, SIOCGIFFLAGS, &ifr); in activate_WOL_suggestion()
70 close(sock); in activate_WOL_suggestion()
75 close(sock); in activate_WOL_suggestion()
83 ioctl(sock, SIOCETHTOOL, &ifr); in activate_WOL_suggestion()
86 ioctl(sock, SIOCETHTOOL, &ifr); in activate_WOL_suggestion()
88 close(sock); in activate_WOL_suggestion()
95 int sock; in suggest_WOL_off() local
[all …]
/external/grpc-grpc/test/core/iomgr/
Dsocket_utils_test.cc81 int sock; in main() local
85 sock = socket(PF_INET, SOCK_STREAM, 0); in main()
86 GPR_ASSERT(sock > 0); in main()
89 grpc_set_socket_nonblocking(sock, 1))); in main()
91 grpc_set_socket_nonblocking(sock, 0))); in main()
93 grpc_set_socket_cloexec(sock, 1))); in main()
95 grpc_set_socket_cloexec(sock, 0))); in main()
97 grpc_set_socket_reuse_addr(sock, 1))); in main()
99 grpc_set_socket_reuse_addr(sock, 0))); in main()
101 grpc_set_socket_low_latency(sock, 1))); in main()
[all …]
/external/virglrenderer/vtest/
Dvtest_server.c42 int sock; in vtest_open_socket() local
44 sock = socket(PF_UNIX, SOCK_STREAM, 0); in vtest_open_socket()
45 if (sock < 0) { in vtest_open_socket()
56 if (bind(sock, (struct sockaddr *)&un, sizeof(un)) < 0) { in vtest_open_socket()
60 if (listen(sock, 1) < 0){ in vtest_open_socket()
64 return sock; in vtest_open_socket()
66 close(sock); in vtest_open_socket()
70 static int wait_for_socket_accept(int sock) in wait_for_socket_accept() argument
76 FD_SET(sock, &read_fds); in wait_for_socket_accept()
78 ret = select(sock + 1, &read_fds, NULL, NULL, NULL); in wait_for_socket_accept()
[all …]
/external/linux-kselftest/tools/testing/selftests/networking/timestamping/
Dtimestamping.c137 static void sendpacket(int sock, struct sockaddr *addr, socklen_t addr_len) in sendpacket() argument
142 res = sendto(sock, sync, sizeof(sync), 0, in sendpacket()
155 int sock, int recvmsg_flags, in printpacket() argument
261 if (ioctl(sock, SIOCGSTAMP, &tv)) in printpacket()
269 if (ioctl(sock, SIOCGSTAMPNS, &ts)) in printpacket()
278 static void recvpacket(int sock, int recvmsg_flags, in recvpacket() argument
301 res = recvmsg(sock, &msg, recvmsg_flags|MSG_DONTWAIT); in recvpacket()
309 sock, recvmsg_flags, in recvpacket()
325 int sock; in main() local
367 sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); in main()
[all …]
/external/wpa_supplicant_8/src/drivers/
Dlinux_ioctl.c19 int linux_set_iface_flags(int sock, const char *ifname, int dev_up) in linux_set_iface_flags() argument
24 if (sock < 0) in linux_set_iface_flags()
30 if (ioctl(sock, SIOCGIFFLAGS, &ifr) != 0) { in linux_set_iface_flags()
47 if (ioctl(sock, SIOCSIFFLAGS, &ifr) != 0) { in linux_set_iface_flags()
59 int linux_iface_up(int sock, const char *ifname) in linux_iface_up() argument
64 if (sock < 0) in linux_iface_up()
70 if (ioctl(sock, SIOCGIFFLAGS, &ifr) != 0) { in linux_iface_up()
81 int linux_get_ifhwaddr(int sock, const char *ifname, u8 *addr) in linux_get_ifhwaddr() argument
87 if (ioctl(sock, SIOCGIFHWADDR, &ifr)) { in linux_get_ifhwaddr()
104 int linux_set_ifhwaddr(int sock, const char *ifname, const u8 *addr) in linux_set_ifhwaddr() argument
[all …]
/external/honggfuzz/libhfnetdriver/
Dnetdriver.c111 static void netDriver_bindToRndLoopback(int sock, sa_family_t sa_family) { in netDriver_bindToRndLoopback() argument
120 if (bind(sock, (struct sockaddr *)&bsaddr, sizeof(bsaddr)) == -1) { in netDriver_bindToRndLoopback()
126 int sock = socket(addr->sa_family, SOCK_STREAM, 0); in netDriver_sockConnAddr() local
127 if (sock == -1) { in netDriver_sockConnAddr()
133 if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &val, (socklen_t)sizeof(val)) == -1) { in netDriver_sockConnAddr()
134 PLOG_W("setsockopt(sock=%d, SOL_SOCKET, SO_REUSEADDR, 1)", sock); in netDriver_sockConnAddr()
138 if (setsockopt(sock, SOL_TCP, TCP_NODELAY, &val, (socklen_t)sizeof(val)) == -1) { in netDriver_sockConnAddr()
139 PLOG_W("setsockopt(sock=%d, SOL_TCP, TCP_NODELAY, 1)", sock); in netDriver_sockConnAddr()
143 netDriver_bindToRndLoopback(sock, addr->sa_family); in netDriver_sockConnAddr()
146 if (TEMP_FAILURE_RETRY(connect(sock, addr, socklen)) == -1) { in netDriver_sockConnAddr()
[all …]
/external/syzkaller/sys/netbsd/
Dsocket.txt11 resource sock[fd]
16 socket(domain flags[socket_domain], type flags[socket_type], proto int8) sock
18 bind(fd sock, addr ptr[in, sockaddr_storage], addrlen len[addr])
19 connect(fd sock, addr ptr[in, sockaddr_storage], addrlen len[addr])
20 accept(fd sock, peer ptr[out, sockaddr_storage, opt], peerlen ptr[inout, len[peer, int32]]) sock
21 paccept(fd sock, peer ptr[out, sockaddr_storage, opt], peerlen ptr[inout, len[peer, int32]], flags …
22 sendto(fd sock, buf buffer[in], len len[buf], f flags[send_flags], addr ptr[in, sockaddr_storage, o…
23 recvfrom(fd sock, buf buffer[out], len len[buf], f flags[recv_flags], addr ptr[in, sockaddr_storage…
24 getsockname(fd sock, addr ptr[out, sockaddr_storage], addrlen ptr[inout, len[addr, int32]])
25 getpeername(fd sock, peer ptr[out, sockaddr_storage], peerlen ptr[inout, len[peer, int32]])
[all …]
/external/syzkaller/sys/freebsd/
Dsocket.txt13 resource sock[fd]
18 socket(domain flags[socket_domain], type flags[socket_type], proto int8) sock
20 bind(fd sock, addr ptr[in, sockaddr_storage], addrlen len[addr])
21 connect(fd sock, addr ptr[in, sockaddr_storage], addrlen len[addr])
22 accept(fd sock, peer ptr[out, sockaddr_storage, opt], peerlen ptr[inout, len[peer, int32]]) sock
23 accept4(fd sock, peer ptr[out, sockaddr_storage, opt], peerlen ptr[inout, len[peer, int32]], flags …
24 sendto(fd sock, buf buffer[in], len len[buf], f flags[send_flags], addr ptr[in, sockaddr_storage, o…
25 recvfrom(fd sock, buf buffer[out], len len[buf], f flags[recv_flags], addr ptr[in, sockaddr_storage…
26 getsockname(fd sock, addr ptr[out, sockaddr_storage], addrlen ptr[inout, len[addr, int32]])
27 getpeername(fd sock, peer ptr[out, sockaddr_storage], peerlen ptr[inout, len[peer, int32]])
[all …]
/external/apache-http/src/org/apache/http/impl/conn/
DDefaultClientConnectionOperator.java145 Socket sock = plain_sf.createSocket(); in openConnection() local
146 conn.opening(sock, target); in openConnection()
149 Socket connsock = plain_sf.connectSocket(sock, in openConnection()
153 if (sock != connsock) { in openConnection()
154 sock = connsock; in openConnection()
155 conn.opening(sock, target); in openConnection()
168 prepareSocket(sock, context, params); in openConnection()
170 Socket layeredsock = layered_sf.createSocket(sock, in openConnection()
174 if (layeredsock != sock) { in openConnection()
179 conn.openCompleted(sf.isSecure(sock), params); in openConnection()
[all …]
/external/python/cpython3/Lib/asyncio/
Dproactor_events.py28 def __init__(self, loop, sock, protocol, waiter=None, argument
31 self._set_extra(sock)
32 self._sock = sock
68 def _set_extra(self, sock): argument
69 self._extra['pipe'] = sock
160 def __init__(self, loop, sock, protocol, waiter=None, argument
164 super().__init__(loop, sock, protocol, waiter, extra, server)
447 def __init__(self, loop, sock, protocol, waiter=None, argument
449 super().__init__(loop, sock, protocol, waiter, extra, server)
450 base_events._set_nodelay(sock)
[all …]
Dselector_events.py58 def _make_socket_transport(self, sock, protocol, waiter=None, *, argument
60 return _SelectorSocketTransport(self, sock, protocol, waiter,
76 def _make_datagram_transport(self, sock, protocol, argument
78 return _SelectorDatagramTransport(self, sock, protocol,
139 def _start_serving(self, protocol_factory, sock, argument
142 self._add_reader(sock.fileno(), self._accept_connection,
143 protocol_factory, sock, sslcontext, server, backlog,
147 self, protocol_factory, sock, argument
156 conn, addr = sock.accept()
174 'socket': sock,
[all …]
/external/adhd/cras/src/tests/
Dutil_unittest.cc22 int sock[2]; in TEST() local
33 ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_STREAM, 0, sock)); in TEST()
37 ASSERT_GE(cras_send_with_fds(sock[0], msg, strlen(msg), send_fds, num_fds), in TEST()
39 ASSERT_GE(cras_recv_with_fds(sock[1], buf, strlen(msg), new_fds, &num_fds), in TEST()
46 close(sock[0]); in TEST()
47 close(sock[1]); in TEST()
68 int sock[2]; in TEST() local
78 ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_STREAM, 0, sock)); in TEST()
80 ASSERT_GE(cras_send_with_fds(sock[0], msg, strlen(msg), &fd[1], 1), 0); in TEST()
81 ASSERT_GE(cras_recv_with_fds(sock[1], buf, strlen(msg), new_fds, &num_fds), in TEST()
[all …]
/external/grpc-grpc/src/core/lib/iomgr/
Dtcp_server_windows.cc187 static grpc_error* prepare_socket(SOCKET sock, in prepare_socket() argument
194 error = grpc_tcp_prepare_socket(sock); in prepare_socket()
199 if (bind(sock, (const grpc_sockaddr*)addr->addr, (int)addr->len) == in prepare_socket()
205 if (listen(sock, SOMAXCONN) == SOCKET_ERROR) { in prepare_socket()
211 if (getsockname(sock, (grpc_sockaddr*)sockname_temp.addr, in prepare_socket()
229 GRPC_ERROR_INT_FD, (intptr_t)sock); in prepare_socket()
232 if (sock != INVALID_SOCKET) closesocket(sock); in prepare_socket()
247 SOCKET sock = INVALID_SOCKET; in start_accept_locked() local
257 sock = WSASocket(AF_INET6, SOCK_STREAM, IPPROTO_TCP, NULL, 0, in start_accept_locked()
259 if (sock == INVALID_SOCKET) { in start_accept_locked()
[all …]

12345678910>>...27