/libcore/ojluni/src/main/java/sun/nio/ch/ |
D | ServerSocketAdaptor.java | 45 private final ServerSocketChannelImpl ssc; field in ServerSocketAdaptor 50 public static ServerSocket create(ServerSocketChannelImpl ssc) { in create() argument 52 return new ServerSocketAdaptor(ssc); in create() 59 private ServerSocketAdaptor(ServerSocketChannelImpl ssc) in ServerSocketAdaptor() argument 62 this.ssc = ssc; in ServerSocketAdaptor() 74 ssc.bind(local, backlog); in bind() 81 if (!ssc.isBound()) in getInetAddress() 83 return Net.getRevealedLocalAddress(ssc.localAddress()).getAddress(); in getInetAddress() 88 if (!ssc.isBound()) in getLocalPort() 90 return Net.asInetSocketAddress(ssc.localAddress()).getPort(); in getLocalPort() [all …]
|
/libcore/luni/src/test/java/libcore/java/nio/channels/ |
D | ServerSocketChannelTest.java | 54 try (ServerSocketChannel ssc = ServerSocketChannel.open()) { in testNonBlockingAccept() argument 55 ssc.configureBlocking(false); in testNonBlockingAccept() 56 ssc.socket().bind(null); in testNonBlockingAccept() 58 assertNull(ssc.accept()); in testNonBlockingAccept() 65 try (ServerSocketChannel ssc = ServerSocketChannel.open()) { in open_initialState() argument 66 assertNull(ssc.socket().getLocalSocketAddress()); in open_initialState() 68 ServerSocket socket = ssc.socket(); in open_initialState() 76 assertSame(ssc, socket.getChannel()); in open_initialState() 82 ServerSocketChannel ssc = ServerSocketChannel.open(); in bind_unresolvedAddress() local 84 ssc.socket().bind(new InetSocketAddress("unresolvedname", 31415)); in bind_unresolvedAddress() [all …]
|
D | SelectorTest.java | 37 ServerSocketChannel ssc = ServerSocketChannel.open(); in testNonBlockingConnect_immediate() local 39 ssc.configureBlocking(false); in testNonBlockingConnect_immediate() 40 ssc.socket().bind(null); in testNonBlockingConnect_immediate() 44 sc.connect(ssc.socket().getLocalSocketAddress()); in testNonBlockingConnect_immediate() 51 ssc.close(); in testNonBlockingConnect_immediate() 112 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_57456() local 116 ssc.configureBlocking(false); in test_57456() 117 ssc.socket().bind(null); in test_57456() 119 sc.connect(ssc.socket().getLocalSocketAddress()); in test_57456() 126 ssc.accept().write(ByteBuffer.allocate(128)); in test_57456() [all …]
|
D | OldSocketChannelTest.java | 283 final ServerSocketChannel ssc = ServerSocketChannel.open(); in test_socketChannel_read_DirectByteBuffer() local 284 ssc.socket().bind(null, 0); in test_socketChannel_read_DirectByteBuffer() 293 ssc.accept().write(buf); in test_socketChannel_read_DirectByteBuffer() 303 sc.connect(ssc.socket().getLocalSocketAddress()); in test_socketChannel_read_DirectByteBuffer() 319 sc.connect(ssc.socket().getLocalSocketAddress()); in test_socketChannel_read_DirectByteBuffer()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/spi/ |
D | AbstractSelectorTest.java | 116 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_register_LSelectorI() local 117 ssc.configureBlocking(false); in test_register_LSelectorI() 119 assertFalse(ssc.isRegistered()); in test_register_LSelectorI() 120 SelectionKey acceptKey = ssc.register(acceptSelector, in test_register_LSelectorI() 122 assertTrue(ssc.isRegistered()); in test_register_LSelectorI() 132 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_register_LSelectorI_error() local 133 ssc.configureBlocking(false); in test_register_LSelectorI_error() 138 ssc.register(acceptSelector, SelectionKey.OP_ACCEPT); in test_register_LSelectorI_error() 143 assertFalse(ssc.isRegistered()); in test_register_LSelectorI_error() 146 ssc.configureBlocking(true); in test_register_LSelectorI_error() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/ |
D | ServerSocketChannelTest.java | 115 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_bind_null() local 117 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() 125 ssc.close(); in test_bind_null() 133 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_bind_failure() local 136 ssc.socket().bind(portHog.socket().getLocalSocketAddress()); in test_bind_failure() 140 ssc.close(); in test_bind_failure() 146 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_bind_closed() local 147 ssc.close(); in test_bind_closed() [all …]
|
D | SelectorTest.java | 46 private ServerSocketChannel ssc; field in SelectorTest 54 ssc = ServerSocketChannel.open(); in setUp() 55 ssc.configureBlocking(false); in setUp() 56 ServerSocket ss = ssc.socket(); in setUp() 64 ssc.close(); in tearDown() 105 SelectionKey key = ssc.register(selector, SelectionKey.OP_ACCEPT); in test_keys() 152 ssc.register(selector, SelectionKey.OP_ACCEPT); in test_selectedKeys() 163 assertEquals(ssc.keyFor(selector), selectedKeys.iterator().next()); in test_selectedKeys() 166 selectedKeys.add(ssc.keyFor(selector)); in test_selectedKeys() 178 ssc.keyFor(selector).cancel(); in test_selectedKeys() [all …]
|
D | SinkChannelTest.java | 465 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_socketChannel_read_close() local 466 ssc.socket().bind(new InetSocketAddress(InetAddress.getLocalHost(), 0 /* any free port */)); in test_socketChannel_read_close() 467 int localPort = ssc.socket().getLocalPort(); in test_socketChannel_read_close() 477 SocketChannel sock = ssc.accept(); in test_socketChannel_read_close() 478 ssc.close(); in test_socketChannel_read_close() 490 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_socketChannel_read_write() local 491 ssc.socket().bind(new InetSocketAddress(InetAddress.getLocalHost(), 0 /* any free port */)); in test_socketChannel_read_write() 492 int localPort = ssc.socket().getLocalPort(); in test_socketChannel_read_write() 495 SocketChannel sock = ssc.accept(); in test_socketChannel_read_write() 502 ssc.close(); in test_socketChannel_read_write()
|
D | SocketChannelTest.java | 2810 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_writev() local 2811 ssc.socket().bind(null); in test_writev() 2813 sc.connect(ssc.socket().getLocalSocketAddress()); in test_writev() 2814 SocketChannel sock = ssc.accept(); in test_writev() 2827 ssc.close(); in test_writev() 2836 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_writev2() local 2837 ssc.configureBlocking(false); in test_writev2() 2838 ssc.socket().bind(null); in test_writev2() 2841 boolean connected = sc.connect(ssc.socket().getLocalSocketAddress()); in test_writev2() 2842 SocketChannel sock = ssc.accept(); in test_writev2() [all …]
|
D | ChannelsTest.java | 595 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_newReader_LReadableByteChannel_LString() local 596 ssc.socket().bind(null); in test_newReader_LReadableByteChannel_LString() 599 sc.connect(ssc.socket().getLocalSocketAddress()); in test_newReader_LReadableByteChannel_LString() 603 ssc.accept().close(); in test_newReader_LReadableByteChannel_LString() 604 ssc.close(); in test_newReader_LReadableByteChannel_LString()
|
/libcore/luni/src/test/java/libcore/java/net/ |
D | SocketTest.java | 114 ServerSocketChannel ssc = ServerSocketChannel.open(); in checkSocketLocalAndRemoteAddresses() local 116 ssc.socket().bind(listenAddr, 0); in checkSocketLocalAndRemoteAddresses() 117 ServerSocket ss = ssc.socket(); in checkSocketLocalAndRemoteAddresses() 125 InetSocketAddress addr = new InetSocketAddress(host, ssc.socket().getLocalPort()); in checkSocketLocalAndRemoteAddresses() 131 SocketChannel in = ssc.accept(); in checkSocketLocalAndRemoteAddresses() 156 assertFalse(ssc.socket().isClosed()); in checkSocketLocalAndRemoteAddresses() 157 assertTrue(ssc.socket().isBound()); in checkSocketLocalAndRemoteAddresses() 165 ssc.close(); in checkSocketLocalAndRemoteAddresses() 167 assertTrue(ssc.socket().isClosed()); in checkSocketLocalAndRemoteAddresses() 168 assertTrue(ssc.socket().isBound()); in checkSocketLocalAndRemoteAddresses() [all …]
|
D | OldServerSocketTest.java | 215 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_accept() local 216 ServerSocket ss = ssc.socket(); in test_accept() 225 ssc.close(); in test_accept()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
D | ScannerTest.java | 448 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_Constructor_LReadableByteChannel() local 449 ssc.socket().bind(null); in test_Constructor_LReadableByteChannel() 452 sc.connect(ssc.socket().getLocalSocketAddress()); in test_Constructor_LReadableByteChannel() 456 ssc.accept().close(); in test_Constructor_LReadableByteChannel() 457 ssc.close(); in test_Constructor_LReadableByteChannel()
|