Home
last modified time | relevance | path

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

123456

/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 …]
DLocalSocketTest.java140 LocalSocket socket = new LocalSocket(); in testAccessors() local
143 assertFalse(socket.isBound()); in testAccessors()
144 socket.bind(addr); in testAccessors()
145 assertTrue(socket.isBound()); in testAccessors()
146 assertEquals(addr, socket.getLocalSocketAddress()); in testAccessors()
148 String str = socket.toString(); in testAccessors()
151 socket.setReceiveBufferSize(1999); in testAccessors()
152 assertEquals(1999 << 1, socket.getReceiveBufferSize()); in testAccessors()
154 socket.setSendBufferSize(3998); in testAccessors()
155 assertEquals(3998 << 1, socket.getSendBufferSize()); in testAccessors()
[all …]
DVpnServiceTest.java68 DatagramSocket socket = new DatagramSocket(); in testProtect_DatagramSocket() local
71 assertFalse(mVpnService.protect(socket)); in testProtect_DatagramSocket()
74 socket.close(); in testProtect_DatagramSocket()
83 Socket socket = new Socket(); in testProtect_Socket() local
86 assertFalse(mVpnService.protect(socket)); in testProtect_Socket()
89 socket.close(); in testProtect_Socket()
98 DatagramSocket socket = new DatagramSocket(); in testProtect_int() local
99 ParcelFileDescriptor descriptor = ParcelFileDescriptor.fromDatagramSocket(socket); in testProtect_int()
110 socket.close(); in testProtect_int()
DIpSecManagerTunnelTest.java335 JavaUdpSocket socket = new JavaUdpSocket(localInner); in getIpSecTunnelTestRunnable()
336 ipsecNetwork.bindSocket(socket.mSocket); in getIpSecTunnelTestRunnable()
337 int innerSocketPort = socket.getPort(); in getIpSecTunnelTestRunnable()
342 socket.mSocket, IpSecManager.DIRECTION_IN, inTransportTransform); in getIpSecTunnelTestRunnable()
344 socket.mSocket, IpSecManager.DIRECTION_OUT, outTransportTransform); in getIpSecTunnelTestRunnable()
347 socket.sendTo(TEST_DATA, remoteInner, socket.getPort()); in getIpSecTunnelTestRunnable()
355 socket.close(); in getIpSecTunnelTestRunnable()
384 JavaUdpSocket socket = new JavaUdpSocket(localInner, innerSocketPort);
385 ipsecNetwork.bindSocket(socket.mSocket);
390 socket.mSocket, IpSecManager.DIRECTION_IN, outTransportTransform);
[all …]
DTrafficStatsTest.java127 final Socket socket = new Socket("localhost", server.getLocalPort()); in testTrafficStatsForLocalhost() local
130 socket.setTcpNoDelay(true); in testTrafficStatsForLocalhost()
131 final OutputStream out = socket.getOutputStream(); in testTrafficStatsForLocalhost()
134 TrafficStats.tagSocket(socket); in testTrafficStatsForLocalhost()
146 socket.close(); in testTrafficStatsForLocalhost()
155 final Socket socket = server.accept(); in testTrafficStatsForLocalhost() local
156 socket.setTcpNoDelay(true); in testTrafficStatsForLocalhost()
158 TrafficStats.tagSocket(socket); in testTrafficStatsForLocalhost()
159 final InputStream in = socket.getInputStream(); in testTrafficStatsForLocalhost()
/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.java107 public QosSocketInfo(@NonNull final Network network, @NonNull final Socket socket) in QosSocketInfo() argument
109 Objects.requireNonNull(socket, "socket cannot be null"); in QosSocketInfo()
112 mParcelFileDescriptor = ParcelFileDescriptor.fromSocket(socket); in QosSocketInfo()
114 new InetSocketAddress(socket.getLocalAddress(), socket.getLocalPort()); in QosSocketInfo()
116 if (socket.isConnected()) { in QosSocketInfo()
117 mRemoteSocketAddress = (InetSocketAddress) socket.getRemoteSocketAddress(); in QosSocketInfo()
/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/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/NetworkStack/tests/integration/src/android/net/util/
DNetworkStackUtilsIntegrationTest.kt105 val socket = Os.socket(AF_INET, SOCK_DGRAM or SOCK_NONBLOCK, IPPROTO_UDP) in testAddArpEntry() constant
106 SocketUtils.bindSocketToInterface(socket, iface.interfaceName) in testAddArpEntry()
109 socket) in testAddArpEntry()
127 Os.sendto(socket, originalPacket, 0 /* bytesOffset */, originalPacket.size /* bytesCount */, in testAddArpEntry()
147 val socket = Os.socket(AF_PACKET, SOCK_RAW, ETH_P_IPV6) in testAttachRaFilter() constant
151 Os.bind(socket, socketAddr) in testAttachRaFilter()
152 Os.setsockoptTimeval(socket, SOL_SOCKET, SO_RCVTIMEO, in testAttachRaFilter()
160 assertNextPacketEquals(socket, echo.readAsArray(), "ICMPv6 echo") in testAttachRaFilter()
162 NetworkStackUtils.attachRaFilter(socket, ARPHRD_ETHER) in testAttachRaFilter()
175 assertNextPacketEquals(socket, ra.readAsArray(), "ICMPv6 RA") in testAttachRaFilter()
[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/apps/Nfc/src/com/android/nfc/snep/
DSnepClient.java140 LlcpSocket socket = null; in connect() local
145 socket = NfcService.getInstance().createLlcpSocket(0, mMiu, mRwSize, 1024); in connect()
146 if (socket == null) { in connect()
151 socket.connectToService(mServiceName); in connect()
154 socket.connectToSap(mPort); in connect()
156 int miu = socket.getRemoteMiu(); in connect()
158 messenger = new SnepMessenger(true, socket, fragmentLength); in connect()
165 if (socket != null) { in connect()
167 socket.close(); in connect()
/packages/modules/adb/daemon/
Djdwp_service.cpp144 static void jdwp_process_event(int socket, unsigned events, void* _proc);
152 JdwpProcess(unique_fd socket, ProcessInfo process) { in JdwpProcess()
155 this->socket = socket; in JdwpProcess()
157 this->fde = fdevent_create(socket.release(), jdwp_process_event, this); in JdwpProcess()
165 if (this->socket >= 0) { in ~JdwpProcess()
166 adb_shutdown(this->socket); in ~JdwpProcess()
167 this->socket = -1; in ~JdwpProcess()
183 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 …]
/packages/apps/Nfc/src/com/android/nfc/echoserver/
DEchoServer.java180 private void handleClient(LlcpSocket socket) { in handleClient() argument
187 int size = socket.receive(dataUnit); in handleClient()
279 LlcpConnectionlessSocket socket; field in EchoServer.ConnectionlessServerThread
294 socket = mService.createLlcpConnectionLessSocket( in run()
296 if (socket == null) { in run()
303 packet = socket.receive(); in run()
329 if (socket != null) { in run()
331 socket.close(); in run()
346 socket.send(mRemoteSap, data); in write()
/packages/services/Telephony/testapps/TestRcsApp/aosp_test_rcsclient/src/com/android/libraries/rcs/simpleclient/protocol/msrp/
DMsrpSession.java60 private final Socket socket; field in MsrpSession
74 Socket socket, MsrpSessionListener listener) throws IOException { in MsrpSession() argument
78 this.socket = socket; in MsrpSession()
79 this.input = socket.getInputStream(); in MsrpSession()
80 this.output = socket.getOutputStream(); in MsrpSession()
118 connectivityManager.registerQosCallback(new QosSocketInfo(network, socket), in listenForBearer()
137 if (!socket.isConnected()) { in send()
182 socket.close(); in terminate()
/packages/apps/Nfc/src/com/android/nfc/sneptest/
DDtaSnepClient.java279 LlcpSocket socket = null; in connect() local
284 socket = NfcService.getInstance().createLlcpSocket(0, mMiu, mRwSize, 1024); in connect()
285 if (socket == null) { in connect()
290 socket.connectToService(mServiceName); in connect()
293 socket.connectToSap(mPort); in connect()
295 int miu = socket.getRemoteMiu(); in connect()
297 messenger = new SnepMessenger(true, socket, fragmentLength); in connect()
304 if (socket != null) { in connect()
306 socket.close(); in connect()
/packages/apps/Nfc/nci/src/com/android/nfc/dhimpl/
DNativeNfcManager.java209 LlcpConnectionlessSocket socket = doCreateLlcpConnectionlessSocket(nSap, sn); in createLlcpConnectionlessSocket() local
210 if (socket != null) { in createLlcpConnectionlessSocket()
211 return socket; in createLlcpConnectionlessSocket()
233 LlcpServerSocket socket = doCreateLlcpServiceSocket(nSap, sn, miu, rw, linearBufferLength); in createLlcpServerSocket() local
234 if (socket != null) { in createLlcpServerSocket()
235 return socket; in createLlcpServerSocket()
257 LlcpSocket socket = doCreateLlcpSocket(sap, miu, rw, linearBufferLength); in createLlcpSocket() local
258 if (socket != null) { in createLlcpSocket()
259 return socket; in createLlcpSocket()
/packages/services/BuiltInPrintService/src/com/android/bips/ipp/
DGetCapabilitiesTask.java56 try (Socket socket = new Socket()) { in isDeviceOnline() argument
57 mSocket = socket; in isDeviceOnline()
59 socket.connect(a, (int) mTimeout); in isDeviceOnline()
71 Socket socket = mSocket; in forceCancel() local
72 if (socket != null) { in forceCancel()
74 socket.close(); in forceCancel()
/packages/services/Car/cpp/bugreport/
Dcarbugreportd.rc2 socket car_br_progress_socket stream 0660 shell log
3 socket car_br_output_socket stream 0660 shell log
4 socket car_br_extra_output_socket stream 0660 shell log
11 # cardumpstatez generates a zipped bugreport but also uses a socket to print the file location once
14 socket dumpstate stream 0660 shell log
/packages/modules/Virtualization/microdroid/
Dmicrodroid_file_contexts136 /dev/socket(/.*)? u:object_r:socket_device:s0
137 /dev/socket/adbd u:object_r:adbd_socket:s0
138 /dev/socket/dnsproxyd u:object_r:dnsproxyd_socket:s0
139 /dev/socket/dumpstate u:object_r:dumpstate_socket:s0
140 /dev/socket/fwmarkd u:object_r:fwmarkd_socket:s0
141 /dev/socket/lmkd u:object_r:lmkd_socket:s0
142 /dev/socket/logd u:object_r:logd_socket:s0
143 /dev/socket/logdr u:object_r:logdr_socket:s0
144 /dev/socket/logdw u:object_r:logdw_socket:s0
145 /dev/socket/statsdw u:object_r:statsdw_socket:s0
[all …]
/packages/modules/Connectivity/tests/unit/java/android/net/
DIpSecManagerTest.java189 Os.socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)); in testOpenEncapsulationSocket()
205 Socket socket = new Socket(); in testApplyTransportModeTransformEnsuresSocketCreation() local
212 socket, IpSecManager.DIRECTION_IN, dummyTransform); in testApplyTransportModeTransformEnsuresSocketCreation()
215 assertNotNull(socket.getFileDescriptor$()); in testApplyTransportModeTransformEnsuresSocketCreation()
220 Socket socket = new Socket(); in testRemoveTransportModeTransformsForcesSocketCreation() local
224 mIpSecManager.removeTransportModeTransforms(socket); in testRemoveTransportModeTransformsForcesSocketCreation()
227 assertNotNull(socket.getFileDescriptor$()); in testRemoveTransportModeTransformsForcesSocketCreation()
237 Os.socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)); in testOpenEncapsulationSocketOnRandomPort()
/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/keepalive/
DIkeNattKeepalive.java48 UdpEncapsulationSocket socket, in IkeNattKeepalive() argument
59 socket, in IkeNattKeepalive()
65 socket, in IkeNattKeepalive()
109 UdpEncapsulationSocket socket, in HardwareKeepaliveCb() argument
114 mSocket = socket; in HardwareKeepaliveCb()
/packages/modules/Connectivity/tests/cts/net/src/android/net/rtp/cts/
DAudioGroupTest.java84 private void assertPacket(DatagramSocket socket, int length) throws Exception { in assertPacket() argument
86 socket.setSoTimeout(3000); in assertPacket()
87 socket.receive(packet); in assertPacket()
91 private void drain(DatagramSocket socket) throws Exception { in drain() argument
93 socket.setSoTimeout(1); in drain()
98 socket.receive(packet); in drain()
/packages/modules/DnsResolver/tests/
Dresolv_tls_unit_test.cpp1026 void enableAsyncHandshake(const std::unique_ptr<DnsTlsSocket>& socket) { in enableAsyncHandshake() argument
1027 ASSERT_TRUE(socket); in enableAsyncHandshake()
1028 DnsTlsSocket* delegate = socket.get(); in enableAsyncHandshake()
1048 auto socket = makeDnsTlsSocket(&observer); in TEST_F() local
1050 ASSERT_TRUE(socket->initialize()); in TEST_F()
1051 ASSERT_TRUE(socket->startHandshake()); in TEST_F()
1056 socket.reset(); in TEST_F()
1069 auto socket = makeDnsTlsSocket(&observer); in TEST_F() local
1072 EXPECT_FALSE(socket->startHandshake()); in TEST_F()
1075 EXPECT_TRUE(socket->initialize()); in TEST_F()
[all …]

123456