Home
last modified time | relevance | path

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

1234

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
DServerSocketChannelTest.java117 assertNull(ssc.socket().getLocalSocketAddress()); in test_bind_null()
119 ssc.socket().bind(null); in test_bind_null()
121 … InetSocketAddress localAddress = (InetSocketAddress) ssc.socket().getLocalSocketAddress(); in test_bind_null()
131 portHog.socket().bind(null); in test_bind_failure()
136 ssc.socket().bind(portHog.socket().getLocalSocketAddress()); in test_bind_failure()
150 ssc.socket().bind(null); in test_bind_closed()
161 portPickingChannel.socket().bind(null); in test_bind_explicitPort()
163 …InetSocketAddress address = (InetSocketAddress) portPickingChannel.socket().getLocalSocketAddress(… in test_bind_explicitPort()
171 ssc.socket().bind(bindAddress); in test_bind_explicitPort()
173 InetSocketAddress boundAddress = (InetSocketAddress) ssc.socket().getLocalSocketAddress(); in test_bind_explicitPort()
[all …]
DSocketChannelTest.java160 assertNull(channel1.socket().getLocalSocketAddress()); in testBind_Null()
162 channel1.socket().bind(null); in testBind_Null()
164 … InetSocketAddress localAddress = (InetSocketAddress) channel1.socket().getLocalSocketAddress(); in testBind_Null()
170 assertNull(channel1.socket().getLocalSocketAddress()); in testBind_Failure()
174 channel1.socket().bind(localAddr1); in testBind_Failure()
184 channel1.socket().bind(null); in testBind_Closed()
193 portPickingChannel.socket().bind(null); in testBind_explicitPort()
194 …InetSocketAddress address = (InetSocketAddress) portPickingChannel.socket().getLocalSocketAddress(… in testBind_explicitPort()
202 channel1.socket().setReuseAddress(true); in testBind_explicitPort()
203 channel1.socket().bind(bindAddress); in testBind_explicitPort()
[all …]
DDatagramChannelTest.java78 channel1.socket().bind(new InetSocketAddress(Inet6Address.LOOPBACK, 0)); in setUp()
79 channel2.socket().bind(new InetSocketAddress(Inet6Address.LOOPBACK, 0)); in setUp()
81 channel1Address = (InetSocketAddress) channel1.socket().getLocalSocketAddress(); in setUp()
82 channel2Address = (InetSocketAddress) channel2.socket().getLocalSocketAddress(); in setUp()
269 DatagramSocket s1 = dc.socket(); in testSocket_BasicStatusBeforeConnect()
288 DatagramSocket s2 = dc.socket(); in testSocket_BasicStatusBeforeConnect()
302 DatagramSocket s1 = dc.socket(); in testSocket_Block_BasicStatusAfterConnect()
304 DatagramSocket s2 = dc.socket(); in testSocket_Block_BasicStatusAfterConnect()
316 DatagramSocket s1 = dc.socket(); in testSocket_NonBlock_BasicStatusAfterConnect()
318 DatagramSocket s2 = dc.socket(); in testSocket_NonBlock_BasicStatusAfterConnect()
[all …]
DUnixSelectorTest.java32 ServerSocket socket = null; field in UnixSelectorTest.Server
39 this.socket = serverChannel.socket(); in initialize()
40 socket.bind(null); in initialize()
80 boolean isConnected = socketChannel.connect(server.socket.getLocalSocketAddress()); in testSelectorAcceptAndRead()
/libcore/luni/src/test/java/libcore/javax/net/ssl/
DSSLServerSocketTest.java32 SSLServerSocket socket = in testSetEnabledCipherSuitesAffectsGetter() local
34 String[] cipherSuites = new String[] {socket.getSupportedCipherSuites()[0]}; in testSetEnabledCipherSuitesAffectsGetter()
35 socket.setEnabledCipherSuites(cipherSuites); in testSetEnabledCipherSuitesAffectsGetter()
36 assertEquals(Arrays.asList(cipherSuites), Arrays.asList(socket.getEnabledCipherSuites())); in testSetEnabledCipherSuitesAffectsGetter()
40 SSLServerSocket socket = in testSetEnabledCipherSuitesStoresCopy() local
42 String[] array = new String[] {socket.getEnabledCipherSuites()[0]}; in testSetEnabledCipherSuitesStoresCopy()
44 socket.setEnabledCipherSuites(array); in testSetEnabledCipherSuitesStoresCopy()
46 assertEquals(originalFirstElement, socket.getEnabledCipherSuites()[0]); in testSetEnabledCipherSuitesStoresCopy()
50 SSLServerSocket socket = in testSetEnabledProtocolsAffectsGetter() local
52 String[] protocols = new String[] {socket.getSupportedProtocols()[0]}; in testSetEnabledProtocolsAffectsGetter()
[all …]
/libcore/luni/src/test/java/libcore/java/nio/channels/
DSocketChannelTest.java98 Socket scSocket = sc.socket(); in test_channelSocketOutputStreamClosureState()
119 Socket scSocket = sc.socket(); in test_channelSocketInputStreamClosureState()
137 assertNull(sc.socket().getLocalSocketAddress()); in test_open_initialState()
139 Socket socket = sc.socket(); in test_open_initialState() local
140 assertFalse(socket.isBound()); in test_open_initialState()
141 assertFalse(socket.isClosed()); in test_open_initialState()
142 assertFalse(socket.isConnected()); in test_open_initialState()
143 assertEquals(-1, socket.getLocalPort()); in test_open_initialState()
144 assertTrue(socket.getLocalAddress().isAnyLocalAddress()); in test_open_initialState()
145 assertNull(socket.getLocalSocketAddress()); in test_open_initialState()
[all …]
DDatagramChannelTest.java66 dc.socket().bind(null); in testNonBlockingRecv()
77 DatagramSocket socket = dc.socket(); in testInitialState() local
78 assertFalse(socket.isBound()); in testInitialState()
79 assertFalse(socket.getBroadcast()); in testInitialState()
80 assertFalse(socket.isClosed()); in testInitialState()
81 assertFalse(socket.isConnected()); in testInitialState()
82 assertEquals(0, socket.getLocalPort()); in testInitialState()
83 assertTrue(socket.getLocalAddress().isAnyLocalAddress()); in testInitialState()
84 assertNull(socket.getLocalSocketAddress()); in testInitialState()
85 assertNull(socket.getInetAddress()); in testInitialState()
[all …]
DServerSocketChannelTest.java41 ssc.socket().bind(null); in testNonBlockingAccept()
53 assertNull(ssc.socket().getLocalSocketAddress()); in test_open_initialState()
55 ServerSocket socket = ssc.socket(); in test_open_initialState() local
56 assertFalse(socket.isBound()); in test_open_initialState()
57 assertFalse(socket.isClosed()); in test_open_initialState()
58 assertEquals(-1, socket.getLocalPort()); in test_open_initialState()
59 assertNull(socket.getLocalSocketAddress()); in test_open_initialState()
60 assertNull(socket.getInetAddress()); in test_open_initialState()
61 assertTrue(socket.getReuseAddress()); in test_open_initialState()
63 assertSame(ssc, socket.getChannel()); in test_open_initialState()
[all …]
/libcore/dalvik/src/main/java/dalvik/system/
DSocketTagger.java53 public final void tag(Socket socket) throws SocketException { in tag() argument
54 if (!socket.isClosed()) { in tag()
55 tag(socket.getFileDescriptor$()); in tag()
59 public final void untag(Socket socket) throws SocketException { in untag() argument
60 if (!socket.isClosed()) { in untag()
61 untag(socket.getFileDescriptor$()); in untag()
65 public final void tag(DatagramSocket socket) throws SocketException { in tag() argument
66 if (!socket.isClosed()) { in tag()
67 tag(socket.getFileDescriptor$()); in tag()
71 public final void untag(DatagramSocket socket) throws SocketException { in untag() argument
[all …]
/libcore/support/src/test/java/tests/net/
DDelegatingSocketFactory.java42 protected Socket configureSocket(Socket socket) throws IOException { in configureSocket() argument
43 return socket; in configureSocket()
48 Socket socket = mDelegate.createSocket(); in createSocket() local
49 return configureSocket(socket); in createSocket()
54 Socket socket = mDelegate.createSocket(host, port); in createSocket() local
55 return configureSocket(socket); in createSocket()
61 Socket socket = mDelegate.createSocket(host, port, localHost, localPort); in createSocket() local
62 return configureSocket(socket); in createSocket()
67 Socket socket = mDelegate.createSocket(host, port); in createSocket() local
68 return configureSocket(socket); in createSocket()
[all …]
DDelegatingSSLSocketFactory.java44 protected SSLSocket configureSocket(SSLSocket socket) throws IOException { in configureSocket() argument
45 return socket; in configureSocket()
60 SSLSocket socket = (SSLSocket) mDelegate.createSocket(); in createSocket() local
61 return configureSocket(socket); in createSocket()
67 SSLSocket socket = (SSLSocket) mDelegate.createSocket(s, host, port, autoClose); in createSocket() local
68 return configureSocket(socket); in createSocket()
73 SSLSocket socket = (SSLSocket) mDelegate.createSocket(host, port); in createSocket() local
74 return configureSocket(socket); in createSocket()
80 SSLSocket socket = (SSLSocket) mDelegate.createSocket(host, port, localHost, localPort); in createSocket() local
81 return configureSocket(socket); in createSocket()
[all …]
/libcore/luni/src/test/java/libcore/java/net/
DSocketTest.java102 ssc.socket().bind(listenAddr, 0); in checkSocketLocalAndRemoteAddresses()
103 ServerSocket ss = ssc.socket(); in checkSocketLocalAndRemoteAddresses()
109 out.socket().setTcpNoDelay(false); in checkSocketLocalAndRemoteAddresses()
111 InetSocketAddress addr = new InetSocketAddress(host, ssc.socket().getLocalPort()); in checkSocketLocalAndRemoteAddresses()
119 in.socket().setTcpNoDelay(false); in checkSocketLocalAndRemoteAddresses()
122 InetSocketAddress listenAddress = (InetSocketAddress) in.socket().getLocalSocketAddress(); in checkSocketLocalAndRemoteAddresses()
123 … InetSocketAddress outRemoteAddress = (InetSocketAddress) out.socket().getRemoteSocketAddress(); in checkSocketLocalAndRemoteAddresses()
124 … InetSocketAddress outLocalAddress = (InetSocketAddress) out.socket().getLocalSocketAddress(); in checkSocketLocalAndRemoteAddresses()
125 InetSocketAddress inLocalAddress = (InetSocketAddress) in.socket().getLocalSocketAddress(); in checkSocketLocalAndRemoteAddresses()
126 … InetSocketAddress inRemoteAddress = (InetSocketAddress) in.socket().getRemoteSocketAddress(); in checkSocketLocalAndRemoteAddresses()
[all …]
DOldAndroidDatagramTest.java42 DatagramSocket socket; field in OldAndroidDatagramTest.Reflector
59 socket.receive(packet); in run()
74 socket.send(packet); in run()
81 socket.close(); in run()
91 socket = new DatagramSocket(port, address); in Reflector()
121 DatagramSocket socket = null; in testDatagram() local
131 socket = new DatagramSocket(2345, InetAddress.getLocalHost()); in testDatagram()
141 socket.send(packet); in testDatagram()
150 socket.receive(packet); in testDatagram()
161 if (socket != null) { in testDatagram()
[all …]
DServerSocketConcurrentCloseTest.java31 public void implAcceptExposedForTest(Socket socket) throws IOException { in testImplAccept_detectsClosedState() argument
32 implAccept(socket); in testImplAccept_detectsClosedState()
39 Socket socket = new Socket((SocketImpl) null) { }; in testImplAccept_detectsClosedState() local
40 serverSocket.implAcceptExposedForTest(socket); in testImplAccept_detectsClosedState()
143 Socket socket = new Socket(); in run() local
144 socket.connect(socketAddress, /* timeout (msec) */ 10); in run()
145 socket.close(); in run()
172 Socket socket = serverSocket.accept(); in run() local
174 socket.close(); in run()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DHandshakeCompletedEventTest.java74 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket(); in test_Constructor() local
75 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session); in test_Constructor()
89 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket(); in test_getCipherSuite() local
90 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session); in test_getCipherSuite()
100 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket(); in test_getLocalCertificates() local
101 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session); in test_getLocalCertificates()
111 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket(); in test_getLocalPrincipal() local
112 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session); in test_getLocalPrincipal()
123 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket(); in test_getPeerCertificateChain() local
124 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session); in test_getPeerCertificateChain()
[all …]
/libcore/support/src/test/java/org/apache/harmony/xnet/tests/support/
DSSLSocketFactoryImpl.java17 public Socket createSocket(Socket socket, String s, int i, boolean flag) in createSocket() argument
19 if (socket == null) { in createSocket()
30 socket = new Socket(s, i); in createSocket()
32 socket = new Socket(s, i); in createSocket()
33 socket.close(); in createSocket()
35 return socket; in createSocket()
/libcore/ojluni/src/main/java/javax/net/ssl/
DSSLContextSpi.java169 SSLSocket socket = getDefaultSocket(); in engineGetDefaultSSLParameters() local
170 return socket.getSSLParameters(); in engineGetDefaultSSLParameters()
193 SSLSocket socket = getDefaultSocket(); in engineGetSupportedSSLParameters() local
195 params.setCipherSuites(socket.getSupportedCipherSuites()); in engineGetSupportedSSLParameters()
196 params.setProtocols(socket.getSupportedProtocols()); in engineGetSupportedSSLParameters()
/libcore/luni/src/test/java/libcore/javax/net/
DServerSocketFactoryTest.java75 Socket socket = new Socket(InetAddress.getLocalHost(), serverSocket.getLocalPort()); in testSocket() local
79 InputStream in = socket.getInputStream(); in testSocket()
83 socket.close(); in testSocket()
98 Socket socket = new Socket(); in assertBacklog() local
99 backlog.add(socket); in assertBacklog()
100 socket.connect(serverAddress, 500); in assertBacklog()
109 for (Socket socket : backlog) { in assertBacklog()
110 socket.close(); in assertBacklog()
/libcore/support/src/test/java/tests/http/
DMockWebServer.java216 Socket socket; in play()
218 socket = serverSocket.accept(); in play()
225 socket.close(); in play()
227 openClientSockets.add(socket); in play()
228 serveConnection(socket); in play()
255 Socket socket; in serveConnection()
260 socket = sslSocketFactory.createSocket( in serveConnection()
262 ((SSLSocket) socket).setUseClientMode(false); in serveConnection()
263 openClientSockets.add(socket); in serveConnection()
266 socket = raw; in serveConnection()
[all …]
/libcore/ojluni/src/main/java/java/net/
DSocketOutputStream.java49 private Socket socket = null; field in SocketOutputStream
60 socket = impl.getSocket(); in SocketOutputStream()
169 if (socket != null) { in close()
170 if (!socket.isClosed()) in close()
171 socket.close(); in close()
DAbstractPlainSocketImpl.java96 if (socket != null) in create()
97 socket.setCreated(); in create()
328 if (!closePending && (socket == null || !socket.isBound())) { in doConnect()
345 if (socket != null) { in doConnect()
346 socket.setBound(); in doConnect()
347 socket.setConnected(); in doConnect()
364 if (!closePending && (socket == null || !socket.isBound())) { in bind()
369 if (socket != null) in bind()
370 socket.setBound(); in bind()
DSocketInputStream.java51 private Socket socket = null; field in SocketInputStream
62 socket = impl.getSocket(); in SocketInputStream()
259 if (socket != null) { in close()
260 if (!socket.isClosed()) in close()
261 socket.close(); in close()
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/
DHttpURLConnectionTest.java91 Socket socket = serverSocket.accept(); in run() local
92 socket.setSoTimeout(1000); in run()
94 int num = socket.getInputStream().read(buff); in run()
95 socket.getOutputStream().write(( in run()
99 num = socket.getInputStream().read(buff); in run()
102 socket = serverSocket.accept(); in run()
103 socket.setSoTimeout(1000); in run()
104 num = socket.getInputStream().read(buff); in run()
110 socket.getOutputStream().write(( in run()
/libcore/support/src/test/java/libcore/javax/net/ssl/
DForwardingX509ExtendedKeyManager.java38 public String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket) { in chooseClientAlias() argument
39 return delegate.chooseClientAlias(keyType, issuers, socket); in chooseClientAlias()
43 public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket) { in chooseServerAlias() argument
44 return delegate.chooseServerAlias(keyType, issuers, socket); in chooseServerAlias()
DTestKeyManager.java63 public String chooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket) { in chooseClientAlias() argument
71 dumpSocket(socket); in chooseClientAlias()
73 return dumpAlias(keyManager.chooseClientAlias(keyTypes, issuers, socket)); in chooseClientAlias()
88 public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket) { in chooseServerAlias() argument
94 dumpSocket(socket); in chooseServerAlias()
96 return dumpAlias(keyManager.chooseServerAlias(keyType, issuers, socket)); in chooseServerAlias()
99 private void dumpSocket(Socket socket) { in dumpSocket() argument
101 out.print(String.valueOf(socket)); in dumpSocket()

1234