/libcore/luni/src/test/java/libcore/javax/net/ssl/ |
H A D | SSLServerSocketTest.java | 32 SSLServerSocket socket = 34 String[] cipherSuites = new String[] {socket.getSupportedCipherSuites()[0]}; 35 socket.setEnabledCipherSuites(cipherSuites); 36 assertEquals(Arrays.asList(cipherSuites), Arrays.asList(socket.getEnabledCipherSuites())); 40 SSLServerSocket socket = 42 String[] array = new String[] {socket.getEnabledCipherSuites()[0]}; 44 socket.setEnabledCipherSuites(array); 46 assertEquals(originalFirstElement, socket.getEnabledCipherSuites()[0]); 50 SSLServerSocket socket = 52 String[] protocols = new String[] {socket [all...] |
/libcore/support/src/test/java/tests/util/ |
H A D | DelegatingSSLSocketFactory.java | 40 * Invoked after obtaining a socket from the delegate and before returning it to the caller. 44 protected void configureSocket(@SuppressWarnings("unused") SSLSocket socket) {} argument 58 SSLSocket socket = (SSLSocket) mDelegate.createSocket(); 59 configureSocket(socket); 60 return socket; 66 SSLSocket socket = (SSLSocket) mDelegate.createSocket(s, host, port, autoClose); 67 configureSocket(socket); 68 return socket; 73 SSLSocket socket = (SSLSocket) mDelegate.createSocket(host, port); 74 configureSocket(socket); [all...] |
/libcore/luni/src/test/java/libcore/java/nio/channels/ |
H A D | SocketChannelTest.java | 105 Socket scSocket = sc.socket(); 126 Socket scSocket = sc.socket(); 144 assertNull(sc.socket().getLocalSocketAddress()); 146 Socket socket = sc.socket(); 147 assertFalse(socket.isBound()); 148 assertFalse(socket.isClosed()); 149 assertFalse(socket.isConnected()); 150 assertEquals(-1, socket.getLocalPort()); 151 assertTrue(socket [all...] |
H A D | DatagramChannelTest.java | 61 dc.socket().bind(null); 72 DatagramSocket socket = dc.socket(); 73 assertFalse(socket.isBound()); 74 assertFalse(socket.getBroadcast()); 75 assertFalse(socket.isClosed()); 76 assertFalse(socket.isConnected()); 77 assertEquals(0, socket.getLocalPort()); 78 assertTrue(socket.getLocalAddress().isAnyLocalAddress()); 79 assertNull(socket [all...] |
H A D | ServerSocketChannelTest.java | 38 ssc.socket().bind(null); 50 assertNull(ssc.socket().getLocalSocketAddress()); 52 ServerSocket socket = ssc.socket(); 53 assertFalse(socket.isBound()); 54 assertFalse(socket.isClosed()); 55 assertEquals(-1, socket.getLocalPort()); 56 assertNull(socket.getLocalSocketAddress()); 57 assertNull(socket.getInetAddress()); 58 assertTrue(socket [all...] |
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/ |
H A D | ServerSocketChannelTest.java | 117 assertNull(ssc.socket().getLocalSocketAddress()); 119 ssc.socket().bind(null); 121 InetSocketAddress localAddress = (InetSocketAddress) ssc.socket().getLocalSocketAddress(); 131 portHog.socket().bind(null); 136 ssc.socket().bind(portHog.socket().getLocalSocketAddress()); 150 ssc.socket().bind(null); 161 portPickingChannel.socket().bind(null); 163 InetSocketAddress address = (InetSocketAddress) portPickingChannel.socket().getLocalSocketAddress(); 171 ssc.socket() 592 Socket socket; field in class:ServerSocketChannelTest.WriteSocketThread 596 WriteSocketThread(Socket socket, byte[] buffer) argument [all...] |
H A D | MockServerSocketChannel.java | 33 public ServerSocket socket() { method in class:MockServerSocketChannel
|
/libcore/dalvik/src/main/java/dalvik/system/ |
H A D | SocketTagger.java | 24 * Callbacks for socket assignment and reassignment. 37 * thread. The socket is either newly connected or reused from a connection 47 * <p><strong>Note:</strong> this method will not be invoked when the socket 52 public final void tag(Socket socket) throws SocketException { argument 53 if (!socket.isClosed()) { 54 tag(socket.getFileDescriptor$()); 58 public final void untag(Socket socket) throws SocketException { argument 59 if (!socket.isClosed()) { 60 untag(socket.getFileDescriptor$()); 65 * Sets this process' socket tagge [all...] |
/libcore/luni/src/main/java/java/nio/ |
H A D | ServerSocketChannelImpl.java | 45 private final ServerSocketAdapter socket; field in class:ServerSocketChannelImpl 51 this.socket = new ServerSocketAdapter(this); 54 @Override public ServerSocket socket() { method in class:ServerSocketChannelImpl 55 return socket; 63 if (!socket.isBound()) { 67 // Create an empty socket channel. This will be populated by ServerSocketAdapter.implAccept. 73 socket.implAccept(result); 78 // Otherwise, this is a non-blocking socket and there's nothing ready, so we'll 102 IoUtils.setBlocking(socket.getFD$(), blocking); 107 if (!socket [all...] |
H A D | DatagramChannelImpl.java | 58 private DatagramSocket socket; field in class:DatagramChannelImpl 72 // whether the socket is bound 83 fd = IoBridge.socket(false); 97 * Getting the internal DatagramSocket If we have not the socket, we create 101 synchronized public DatagramSocket socket() { method in class:DatagramChannelImpl 102 if (socket == null) { 103 socket = new DatagramSocketAdapter(new PlainDatagramSocketImpl(fd, localPort), this); 105 return socket; 114 * if the associated socket (if present) needs to be updated 128 if (updateSocketState && socket ! [all...] |
H A D | SocketChannelImpl.java | 74 private SocketAdapter socket = null; field in class:SocketChannelImpl 79 // The local address the socket is bound to. 85 // Whether the socket is bound. 93 * Constructor for creating a connected socket channel. 100 * Constructor for creating an optionally connected socket channel. 105 fd = (connect ? IoBridge.socket(true) : new FileDescriptor()); 118 * Getting the internal Socket If we have not the socket, we create a new 122 synchronized public Socket socket() { method in class:SocketChannelImpl 123 if (socket == null) { 131 socket [all...] |
/libcore/luni/src/main/java/java/util/logging/ |
H A D | SocketHandler.java | 26 * A handler that writes log messages to a socket connection. 63 // the socket connection 64 private Socket socket; field in class:SocketHandler 103 // Initialize the socket connection and prepare the output stream 125 this.socket = new Socket(host, p); 131 super.internalSetOutputStream(new BufferedOutputStream(this.socket.getOutputStream())); 141 if (this.socket != null) { 142 this.socket.close(); 143 this.socket = null; 146 getErrorManager().error("Exception occurred when closing the socket handle [all...] |
/libcore/support/src/test/java/org/apache/harmony/xnet/tests/support/ |
H A D | SSLSocketFactoryImpl.java | 17 public Socket createSocket(Socket socket, String s, int i, boolean flag) argument 19 if (socket == null) { 20 throw new IOException("incorrect socket"); 30 socket = new Socket(s, i); 32 socket = new Socket(s, i); 33 socket.close(); 35 return socket;
|
/libcore/luni/src/test/java/libcore/java/net/ |
H A D | SocketTest.java | 45 // Closing a closed socket does nothing. 63 // Now close the socket... 95 ssc.socket().bind(listenAddr, 0); 96 ServerSocket ss = ssc.socket(); 98 // Open a socket to the local port. 102 out.socket().setTcpNoDelay(false); 104 InetSocketAddress addr = new InetSocketAddress(host, ssc.socket().getLocalPort()); 112 in.socket().setTcpNoDelay(false); 115 InetSocketAddress listenAddress = (InetSocketAddress) in.socket().getLocalSocketAddress(); 116 InetSocketAddress outRemoteAddress = (InetSocketAddress) out.socket() [all...] |
H A D | OldAndroidDatagramTest.java | 42 DatagramSocket socket; field in class:OldAndroidDatagramTest.Reflector 59 socket.receive(packet); 74 socket.send(packet); 81 socket.close(); 91 socket = new DatagramSocket(port, address); 121 DatagramSocket socket = null; 131 socket = new DatagramSocket(2345, InetAddress.getLocalHost()); 141 socket.send(packet); 150 socket.receive(packet); 161 if (socket ! [all...] |
H A D | OldUnixSocketTest.java | 106 Socket socket = new Socket("127.0.0.1", port, false); 107 OutputStream o = socket.getOutputStream(); 113 socket.close();
|
/libcore/luni/src/main/java/javax/net/ssl/ |
H A D | X509KeyManager.java | 39 * @param socket 40 * the socket for the connection, or {@code null} if 41 * the alias selected does not depend on a specific socket. 46 Socket socket); 57 * @param socket 58 * the socket for the connection, or {@code null} if 59 * the alias selected does not depend on a specific socket. 64 Socket socket); 45 chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket) argument 63 chooseServerAlias(String keyType, Principal[] issuers, Socket socket) argument
|
/libcore/luni/src/test/java/libcore/javax/net/ |
H A D | ServerSocketFactoryTest.java | 75 Socket socket = new Socket(InetAddress.getLocalHost(), serverSocket.getLocalPort()); 79 InputStream in = socket.getInputStream(); 83 socket.close(); 98 Socket socket = new Socket(); 99 backlog.add(socket); 100 socket.connect(serverAddress, 500); 109 for (Socket socket : backlog) { 110 socket.close();
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/ |
H A D | HandshakeCompletedEventTest.java | 75 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket(); 76 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session); 90 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket(); 91 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session); 101 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket(); 102 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session); 112 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket(); 113 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session); 124 SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket(); 125 HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, sessio 202 private SSLSocket socket; field in class:HandshakeCompletedEventTest [all...] |
/libcore/support/src/test/java/libcore/javax/net/ssl/ |
H A D | ForwardingX509ExtendedKeyManager.java | 38 public String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket) { argument 39 return delegate.chooseClientAlias(keyType, issuers, socket); 43 public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket) { argument 44 return delegate.chooseServerAlias(keyType, issuers, socket);
|
/libcore/luni/src/main/native/ |
H A D | NetworkUtilities.h | 18 #include <sys/socket.h> 28 // you want if you're about to perform an operation on a socket, since all our sockets 38 // for the MCAST_JOIN_GROUP, MCAST_LEAVE_GROUP, and other multicast socket options.
|
H A D | java_io_FileDescriptor.cpp | 21 #include <sys/socket.h> 25 // If getsockopt succeeds, we know we're dealing with a socket. 26 // This is the cheapest way we know of to test whether an fd is a socket.
|
/libcore/support/src/test/java/tests/http/ |
H A D | MockWebServer.java | 197 logger.log(Level.WARNING, "MockWebServer server socket close failed", e); 204 logger.log(Level.WARNING, "MockWebServer socket close failed", e); 216 Socket socket; 218 socket = serverSocket.accept(); 225 socket.close(); 227 openClientSockets.add(socket); 228 serveConnection(socket); 255 Socket socket; 260 socket = sslSocketFactory.createSocket( 262 ((SSLSocket) socket) [all...] |
/libcore/luni/src/main/java/java/nio/channels/ |
H A D | ServerSocketChannel.java | 29 * stream-oriented listening socket. Binding and manipulation of socket options 31 * by calling {@code socket()}. ServerSocketChannels can not be constructed for 32 * an already existing server-socket, nor can a {@link java.net.SocketImpl} be assigned. 34 * A server-socket channel is open but not bound when created by the {@code 51 * Creates an open and unbound server-socket channel. 65 * Gets the valid operations of this channel. Server-socket channels support 78 * Return the server-socket assigned this channel, which does not declare 81 * @return the server-socket assigned to this channel. 83 public abstract ServerSocket socket(); method in class:ServerSocketChannel [all...] |
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/ |
H A D | HttpURLConnectionTest.java | 91 Socket socket = serverSocket.accept(); 92 socket.setSoTimeout(1000); 94 int num = socket.getInputStream().read(buff); 95 socket.getOutputStream().write(( 99 num = socket.getInputStream().read(buff); 102 socket = serverSocket.accept(); 103 socket.setSoTimeout(1000); 104 num = socket.getInputStream().read(buff); 110 socket.getOutputStream().write((
|