Home
last modified time | relevance | path

Searched refs:socket (Results 1 – 25 of 301) sorted by relevance

12345678910>>...13

/packages/modules/Bluetooth/system/osi/src/
Dsocket.cc56 ret->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); in socket_new()
85 void socket_free(socket_t* socket) { in socket_free() argument
86 if (!socket) return; in socket_free()
88 socket_unregister(socket); in socket_free()
89 close(socket->fd); in socket_free()
90 osi_free(socket); in socket_free()
93 bool socket_listen(const socket_t* socket, port_t port) { in socket_listen() argument
94 log::assert_that(socket != NULL, "assert failed: socket != NULL"); in socket_listen()
100 if (bind(socket->fd, (struct sockaddr*)&addr, sizeof(addr)) == -1) { in socket_listen()
105 if (listen(socket->fd, 10) == -1) { in socket_listen()
[all …]
/packages/modules/Bluetooth/system/test/mock/
Dmock_osi_socket.h42 std::function<socket_t*(const socket_t* socket)> body{
44 socket_t* operator()(const socket_t* socket) { return body(socket); }; in operator()
53 std::function<ssize_t(const socket_t* socket)> body{
55 ssize_t operator()(const socket_t* socket) { return body(socket); }; in operator()
63 std::function<void(socket_t* socket)> body{[](socket_t* /* socket */) {}};
64 void operator()(socket_t* socket) { body(socket); }; in operator()
73 std::function<bool(const socket_t* socket, port_t port)> body{
77 bool operator()(const socket_t* socket, port_t port) { in operator()
78 return body(socket, port); in operator()
109 std::function<ssize_t(const socket_t* socket, void* buf, size_t count)> body{
[all …]
Dmock_osi_socket.cc52 socket_t* socket_accept(const socket_t* socket) { in socket_accept() argument
54 return test::mock::osi_socket::socket_accept(socket); in socket_accept()
56 ssize_t socket_bytes_available(const socket_t* socket) { in socket_bytes_available() argument
58 return test::mock::osi_socket::socket_bytes_available(socket); in socket_bytes_available()
60 void socket_free(socket_t* socket) { in socket_free() argument
62 test::mock::osi_socket::socket_free(socket); in socket_free()
64 bool socket_listen(const socket_t* socket, port_t port) { in socket_listen() argument
66 return test::mock::osi_socket::socket_listen(socket, port); in socket_listen()
76 ssize_t socket_read(const socket_t* socket, void* buf, size_t count) { in socket_read() argument
78 return test::mock::osi_socket::socket_read(socket, buf, count); in socket_read()
[all …]
/packages/modules/Connectivity/tests/cts/net/src/android/net/cts/
DSSLCertificateSocketFactoryTest.java134 Socket socket = new Socket(); in createSocket_io_error_expected() local
135 mSocketFactory.createSocket(socket, "localhost", HTTPS_PORT, true); in createSocket_io_error_expected()
174 Socket socket = mSocketFactory.createSocket(TEST_HOST, HTTPS_PORT); in createSocket_simple_with_hostname_verification() local
175 assertConnectedSocket(socket); in createSocket_simple_with_hostname_verification()
176 socket.close(); in createSocket_simple_with_hostname_verification()
202 Socket socket = mSocketFactory.createSocket(underlying, TEST_HOST, HTTPS_PORT, true); in createSocket_wrapped_with_hostname_verification() local
203 assertConnectedSocket(socket); in createSocket_wrapped_with_hostname_verification()
204 socket.close(); in createSocket_wrapped_with_hostname_verification()
231 Socket socket = mSocketFactory.createSocket(TEST_HOST, HTTPS_PORT, mLocalAddress, 0); in createSocket_bound_with_hostname_verification() local
232 assertConnectedSocket(socket); in createSocket_bound_with_hostname_verification()
[all …]
DVpnServiceTest.java95 DatagramSocket socket = new DatagramSocket(); in testProtect_DatagramSocket() local
98 assertFalse(mVpnService.protect(socket)); in testProtect_DatagramSocket()
101 socket.close(); in testProtect_DatagramSocket()
111 Socket socket = new Socket(); in testProtect_Socket() local
114 assertFalse(mVpnService.protect(socket)); in testProtect_Socket()
117 socket.close(); in testProtect_Socket()
127 DatagramSocket socket = new DatagramSocket(); in testProtect_int() local
128 ParcelFileDescriptor descriptor = ParcelFileDescriptor.fromDatagramSocket(socket); in testProtect_int()
139 socket.close(); in testProtect_int()
/packages/modules/Connectivity/tests/unit/java/android/net/
DQosSocketFilterTest.java103 DatagramSocket socket = new DatagramSocket(new InetSocketAddress("127.0.0.1", 0)); in testProtocolMatch() local
104 socket.connect(new InetSocketAddress("127.0.0.1", socket.getLocalPort() + 10)); in testProtocolMatch()
107 QosSocketInfo socketInfo = new QosSocketInfo(mNetwork, socket); in testProtocolMatch()
115 socket.close(); in testProtocolMatch()
121 DatagramSocket socket = new DatagramSocket(new InetSocketAddress("127.0.0.1", 0)); in testValidate() local
122 socket.connect(new InetSocketAddress("127.0.0.1", socket.getLocalPort() + 7)); in testValidate()
125 QosSocketInfo socketInfo = new QosSocketInfo(mNetwork, socket); in testValidate()
131 socket.close(); in testValidate()
137 DatagramSocket socket; in testValidateUnbind() local
138 socket = new DatagramSocket(null); in testValidateUnbind()
[all …]
DQosSocketInfoTest.java61 Socket socket = new Socket(serverAddr.getAddress(), server.getLocalPort(), in testConstructWithSock() local
65 QosSocketInfo sockInfo = new QosSocketInfo(mMockNetwork, socket); in testConstructWithSock()
68 .equals(new InetSocketAddress(socket.getLocalAddress(), socket.getLocalPort()))); in testConstructWithSock()
70 .equals((InetSocketAddress) socket.getRemoteSocketAddress())); in testConstructWithSock()
77 socket.close(); in testConstructWithSock()
89 DatagramSocket socket = new DatagramSocket(null); in testConstructWithDatagramSock() local
90 socket.setReuseAddress(true); in testConstructWithDatagramSock()
91 socket.bind(clientAddr); in testConstructWithDatagramSock()
92 socket.connect(serverAddr); in testConstructWithDatagramSock()
97 QosSocketInfo sockInfo = new QosSocketInfo(mMockNetwork, socket); in testConstructWithDatagramSock()
[all …]
/packages/modules/Connectivity/framework/src/android/net/
DNetwork.java208 Socket socket = createSocket(); in connectToHost() local
211 if (localAddress != null) socket.bind(localAddress); in connectToHost()
212 socket.connect(new InetSocketAddress(hostAddresses[i], port)); in connectToHost()
214 return socket; in connectToHost()
216 if (failed) IoUtils.closeQuietly(socket); in connectToHost()
234 Socket socket = createSocket(); in createSocket() local
237 socket.bind(new InetSocketAddress(localAddress, localPort)); in createSocket()
238 socket.connect(new InetSocketAddress(address, port)); in createSocket()
241 if (failed) IoUtils.closeQuietly(socket); in createSocket()
243 return socket; in createSocket()
[all …]
DQosSocketInfo.java124 public QosSocketInfo(@NonNull final Network network, @NonNull final Socket socket) in QosSocketInfo() argument
126 Objects.requireNonNull(socket, "socket cannot be null"); in QosSocketInfo()
129 mParcelFileDescriptor = ParcelFileDescriptor.fromSocket(socket); in QosSocketInfo()
131 new InetSocketAddress(socket.getLocalAddress(), socket.getLocalPort()); in QosSocketInfo()
134 if (socket.isConnected()) { in QosSocketInfo()
135 mRemoteSocketAddress = (InetSocketAddress) socket.getRemoteSocketAddress(); in QosSocketInfo()
148 public QosSocketInfo(@NonNull final Network network, @NonNull final DatagramSocket socket) in QosSocketInfo() argument
150 Objects.requireNonNull(socket, "socket cannot be null"); in QosSocketInfo()
153 mParcelFileDescriptor = ParcelFileDescriptor.fromDatagramSocket(socket); in QosSocketInfo()
155 new InetSocketAddress(socket.getLocalAddress(), socket.getLocalPort()); in QosSocketInfo()
[all …]
/packages/modules/Bluetooth/system/osi/include/
Dsocket.h30 typedef void (*socket_cb)(socket_t* socket, void* context);
46 void socket_free(socket_t* socket);
51 bool socket_listen(const socket_t* socket, port_t port);
56 socket_t* socket_accept(const socket_t* socket);
68 ssize_t socket_read(const socket_t* socket, void* buf, size_t count);
80 ssize_t socket_write(const socket_t* socket, const void* buf, size_t count);
87 ssize_t socket_write_and_transfer_fd(const socket_t* socket, const void* buf,
97 ssize_t socket_bytes_available(const socket_t* socket);
104 void socket_register(socket_t* socket, reactor_t* reactor, void* context,
109 void socket_unregister(socket_t* socket);
/packages/modules/Bluetooth/android/pandora/mmi2grpc/mmi2grpc/
D_modem.py16 import socket
22 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
25 self.socket = s
29 …self.socket.sendall(b'REM0\r\nAT+REMOTECALL=6,0,0,"' + str(phone_number).encode("utf-8") + b'",0\r…
30 self.socket.close()
34 …self.socket.sendall(b'REM0\r\nAT+REMOTECALL=4,0,0,"' + str(phone_number).encode("utf-8") + b'",129…
38 …self.socket.sendall(b'REM0\r\nAT+REMOTECALL=0,0,0,"' + str(phone_number).encode("utf-8") + b'",129…
/packages/apps/Dialer/java/com/android/voicemail/impl/mail/
DMailTransport.java60 private Socket socket; field in MailTransport
130 socket = createSocket(); in open()
133 socket.connect(address, SOCKET_CONNECT_TIMEOUT); in open()
143 in = new BufferedInputStream(socket.getInputStream(), 1024); in open()
144 out = new BufferedOutputStream(socket.getOutputStream(), 512); in open()
145 socket.setSoTimeout(SOCKET_READ_TIMEOUT); in open()
159 socket.close(); in open()
160 socket = null; in open()
207 socket = in reopenTls()
209 .createSocket(socket, address.getHostName(), address.getPort(), true); in reopenTls()
[all …]
/packages/modules/Bluetooth/tools/rootcanal/model/setup/
Dtest_channel_transport.cc46 void TestChannelTransport::OnCommandReady(AsyncDataChannel* socket, in OnCommandReady() argument
49 ssize_t bytes_read = socket->Recv(&command_name_size, 1); in OnCommandReady()
53 socket->Close(); in OnCommandReady()
57 bytes_read = socket->Recv(command_name_raw.data(), command_name_size); in OnCommandReady()
67 socket->Close(); in OnCommandReady()
72 bytes_read = socket->Recv(&num_args, 1); in OnCommandReady()
80 bytes_read = socket->Recv(&arg_size, 1); in OnCommandReady()
87 bytes_read = socket->Recv(arg.data(), arg_size); in OnCommandReady()
99 std::shared_ptr<AsyncDataChannel> socket, const std::string& response) { in SendResponse() argument
109 ssize_t written = socket->Send(size_buf, 4); in SendResponse()
[all …]
/packages/modules/adb/
Dtest_adb.py27 import socket
40 with socket.socket() as s:
45 def fake_adbd(protocol=socket.AF_INET, port=0):
48 serversock = socket.socket(protocol, socket.SOCK_STREAM)
49 serversock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
50 if protocol == socket.AF_INET:
57 readsock, writesock = socket.socketpair()
88 ready.shutdown(socket.SHUT_RDWR)
323 sock.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
326 linger = sock.getsockopt(socket.SOL_SOCKET, socket.SO_LINGER, 16)
[all …]
DSOCKET-ACTIVATION.txt1 adb can be configured to work with systemd-style socket activation,
12 After=adb.socket
13 Requires=adb.socket
20 --- START adb.socket CUT HERE ---
29 --- END adb.socket CUT HERE ---
42 serve socket, not the accepted connection socket.
/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/keepalive/
DIkeNattKeepalive.java86 mNattKeepaliveConfig.socket, in IkeNattKeepalive()
94 public final UdpEncapsulationSocket socket; field in IkeNattKeepalive.KeepaliveConfig
104 UdpEncapsulationSocket socket, in KeepaliveConfig() argument
111 this.socket = socket; in KeepaliveConfig()
146 mNattKeepaliveConfig.socket, in finishRestartingWithNewHardwareKeepalive()
176 mNattKeepaliveConfig.socket, in restart()
208 UdpEncapsulationSocket socket, in createSoftwareKeepaliveImpl() argument
210 return new SoftwareKeepaliveImpl(context, dest, socket, alarmConfig); in createSoftwareKeepaliveImpl()
226 nattKeepaliveConfig.socket, in createHardwareKeepaliveImpl()
242 UdpEncapsulationSocket socket, in HardwareKeepaliveCb() argument
[all …]
/packages/modules/Bluetooth/system/btif/src/
Dbtif_sock_sco.cc61 socket_t* socket; member
69 static void sco_socket_free_locked(sco_socket_t* socket);
75 static void socket_read_ready_cb(socket_t* socket, void* context);
140 socket_t* socket = NULL; in sco_socket_establish_locked() local
163 socket = socket_new_from_fd(pair[1]); in sco_socket_establish_locked()
164 if (!socket) { in sco_socket_establish_locked()
170 sco_socket->socket = socket; // Hang on to the other end. in sco_socket_establish_locked()
173 socket_register(socket, thread_get_reactor(thread), sco_socket, in sco_socket_establish_locked()
203 socket_free(sco_socket->socket); in sco_socket_free_locked()
261 if (socket_write_and_transfer_fd(sco_socket->socket, &connect_signal, in connection_request_cb()
[all …]
/packages/modules/Connectivity/framework/src/android/net/util/
DDnsUtils.java167 final FileDescriptor socket; in findSrcAddress() local
169 socket = Os.socket(domain, SOCK_DGRAM, IPPROTO_UDP); in findSrcAddress()
175 if (network != null) network.bindSocket(socket); in findSrcAddress()
176 Os.connect(socket, new InetSocketAddress(addr, 0)); in findSrcAddress()
177 return ((InetSocketAddress) Os.getsockname(socket)).getAddress(); in findSrcAddress()
181 IoUtils.closeQuietly(socket); in findSrcAddress()
361 final FileDescriptor socket; in checkConnectivity() local
363 socket = Os.socket(domain, SOCK_DGRAM, IPPROTO_UDP); in checkConnectivity()
368 if (network != null) network.bindSocket(socket); in checkConnectivity()
369 Os.connect(socket, addr); in checkConnectivity()
[all …]
/packages/modules/NetworkStack/tests/integration/signature/android/net/util/
DNetworkStackUtilsIntegrationTest.kt122 val socket = Os.socket(AF_INET, SOCK_DGRAM or SOCK_NONBLOCK, IPPROTO_UDP) in testAddArpEntry() constant
123 SocketUtils.bindSocketToInterface(socket, iface.interfaceName) in testAddArpEntry()
126 socket) in testAddArpEntry()
144 Os.sendto(socket, originalPacket, 0 /* bytesOffset */, originalPacket.size /* bytesCount */, in testAddArpEntry()
163 val socket = Os.socket(AF_PACKET, SOCK_RAW or SOCK_CLOEXEC, 0) in doTestAttachRaFilter() constant
167 Os.bind(socket, socketAddr) in doTestAttachRaFilter()
168 Os.setsockoptTimeval(socket, SOL_SOCKET, SO_RCVTIMEO, in doTestAttachRaFilter()
176 assertNextPacketEquals(socket, echo.readAsArray(), "ICMPv6 echo") in doTestAttachRaFilter()
179 NetworkStackUtils.attachControlPacketFilter(socket) in doTestAttachRaFilter()
181 NetworkStackUtils.attachRaFilter(socket) in doTestAttachRaFilter()
[all …]
/packages/modules/DnsResolver/doh/connection/
Dmod.rs61 fn mark_socket(socket: &std::net::UdpSocket, socket_mark: u32) -> io::Result<()> { in mark_socket()
63 let fd = socket.as_raw_fd(); in mark_socket()
94 let socket = UdpSocket::bind(bind_addr).await?; in build_socket() localVariable
95 let std_socket = socket.into_std()?; in build_socket()
99 let socket = UdpSocket::from_std(std_socket)?; in build_socket() localVariable
100 socket.connect(peer_addr).await?; in build_socket()
101 Ok(socket) in build_socket()
148 let socket = build_socket(to, socket_mark, tag_socket).await?; in new() localVariable
149 let from = socket.local_addr()?; in new()
173 drive(request_rx, status_tx, quiche_conn, socket, net_id, handshake_info).await; in new()
/packages/modules/Bluetooth/system/gd/rust/linux/stack/src/
Dsocket_manager.rs6 use bt_topshim::profiles::socket;
8 use nix::sys::socket::{recvmsg, ControlMessageOwned};
36 pub type SocketType = socket::SocketType;
98 flags: flags | socket::SOCK_FLAG_NO_SDP, in make_l2cap_channel()
139 conn: socket::ConnectionComplete, in to_connecting_socket()
155 sock.fd = match socket::try_from_fd(sockfd.unwrap_or(-1)) { in to_connecting_socket()
272 fn on_incoming_socket_ready(&mut self, socket: BluetoothServerSocket, status: BtStatus); in on_incoming_socket_ready()
288 socket: Option<BluetoothSocket>, in on_outgoing_connection_result()
510 sock: Option<socket::BtSocket>,
555 self.sock = Some(socket::BtSocket::new(&intf.lock().unwrap())); in initialize()
[all …]
/packages/modules/Bluetooth/floss/pandora/floss/
Dsocket_manager.py30 def on_incoming_socket_ready(self, socket, status): argument
68 socket, argument
122 def OnIncomingSocketReady(self, socket, status): argument
125 observer.on_incoming_socket_ready(socket, status)
137 … def OnOutgoingConnectionResult(self, connecting_id, result, socket, *, dbus_unix_fd_list=None): argument
142 socket,
157 def on_incoming_socket_ready(self, socket, status): argument
159 logging.debug('on_incoming_socket_ready: socket: %s, status: %s', socket, status)
172 … def on_outgoing_connection_result(self, connecting_id, result, socket, *, dbus_unix_fd_list=None): argument
175 socket)
/packages/modules/Connectivity/tests/cts/netpermission/updatestatspermission/src/android/net/cts/network/permission/
DUpdateStatsPermissionTest.java61 Socket socket = new Socket("example.com", 80); in testUpdateDeviceStatsPermission() local
62 TrafficStats.tagSocket(socket); in testUpdateDeviceStatsPermission()
68 socket.setTcpNoDelay(true); in testUpdateDeviceStatsPermission()
69 socket.setSoLinger(true, 0); in testUpdateDeviceStatsPermission()
70 OutputStream out = socket.getOutputStream(); in testUpdateDeviceStatsPermission()
75 socket.close(); in testUpdateDeviceStatsPermission()
/packages/modules/ImsMedia/test/app/ImsMediaTestingApp/app/src/main/java/com/example/imsmediatestingapp/
DHandshakeReceiver.java27 DatagramSocket socket = null; field in HandshakeReceiver
41 socket = new DatagramSocket(); in run()
42 socket.setReuseAddress(true); in run()
47 socket.receive(packet); in run()
107 return socket.getLocalPort(); in getBoundSocket()
111 Log.d("", "Closing the socket on port: " + socket.getLocalPort()); in close()
113 socket.close(); in close()
/packages/modules/adb/daemon/
Djdwp_service.cpp141 static void jdwp_process_event(int socket, unsigned events, void* _proc);
149 JdwpProcess(unique_fd socket, ProcessInfo process) { in JdwpProcess()
152 this->socket = socket; in JdwpProcess()
154 this->fde = fdevent_create(socket.release(), jdwp_process_event, this); in JdwpProcess()
163 if (this->socket >= 0) { in ~JdwpProcess()
164 adb_shutdown(this->socket); in ~JdwpProcess()
165 this->socket = -1; in ~JdwpProcess()
181 borrowed_fd socket = -1; member
259 static void jdwp_process_event(int socket, unsigned events, void* _proc) { in jdwp_process_event() argument
261 CHECK_EQ(socket, proc->socket.get()); in jdwp_process_event()
[all …]

12345678910>>...13