/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 | 38 ServerSocketChannel ssc = ServerSocketChannel.open(); in testNonBlockingAccept() local 40 ssc.configureBlocking(false); in testNonBlockingAccept() 41 ssc.socket().bind(null); in testNonBlockingAccept() 43 assertNull(ssc.accept()); in testNonBlockingAccept() 45 ssc.close(); in testNonBlockingAccept() 51 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_open_initialState() local 53 assertNull(ssc.socket().getLocalSocketAddress()); in test_open_initialState() 55 ServerSocket socket = ssc.socket(); in test_open_initialState() 63 assertSame(ssc, socket.getChannel()); in test_open_initialState() 65 ssc.close(); in test_open_initialState() [all …]
|
D | SelectorTest.java | 38 ServerSocketChannel ssc = ServerSocketChannel.open(); in testNonBlockingConnect_immediate() local 40 ssc.configureBlocking(false); in testNonBlockingConnect_immediate() 41 ssc.socket().bind(null); in testNonBlockingConnect_immediate() 45 sc.connect(ssc.socket().getLocalSocketAddress()); in testNonBlockingConnect_immediate() 52 ssc.close(); in testNonBlockingConnect_immediate() 131 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_57456() local 135 ssc.configureBlocking(false); in test_57456() 136 ssc.socket().bind(null); in test_57456() 138 sc.connect(ssc.socket().getLocalSocketAddress()); in test_57456() 145 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 | 593 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_newReader_LReadableByteChannel_LString() local 594 ssc.socket().bind(null); in test_newReader_LReadableByteChannel_LString() 597 sc.connect(ssc.socket().getLocalSocketAddress()); in test_newReader_LReadableByteChannel_LString() 601 ssc.accept().close(); in test_newReader_LReadableByteChannel_LString() 602 ssc.close(); in test_newReader_LReadableByteChannel_LString()
|
/libcore/luni/src/test/java/libcore/java/net/ |
D | SocketTest.java | 100 ServerSocketChannel ssc = ServerSocketChannel.open(); in checkSocketLocalAndRemoteAddresses() local 102 ssc.socket().bind(listenAddr, 0); in checkSocketLocalAndRemoteAddresses() 103 ServerSocket ss = ssc.socket(); in checkSocketLocalAndRemoteAddresses() 111 InetSocketAddress addr = new InetSocketAddress(host, ssc.socket().getLocalPort()); in checkSocketLocalAndRemoteAddresses() 117 SocketChannel in = ssc.accept(); in checkSocketLocalAndRemoteAddresses() 142 assertFalse(ssc.socket().isClosed()); in checkSocketLocalAndRemoteAddresses() 143 assertTrue(ssc.socket().isBound()); in checkSocketLocalAndRemoteAddresses() 151 ssc.close(); in checkSocketLocalAndRemoteAddresses() 153 assertTrue(ssc.socket().isClosed()); in checkSocketLocalAndRemoteAddresses() 154 assertTrue(ssc.socket().isBound()); in checkSocketLocalAndRemoteAddresses() [all …]
|
D | OldServerSocketTest.java | 224 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_accept() local 225 ServerSocket ss = ssc.socket(); in test_accept() 234 ssc.close(); in test_accept()
|
/libcore/luni/src/test/java/libcore/dalvik/system/ |
D | SocketTaggingTest.java | 109 ServerSocketChannel ssc = ServerSocketChannel.open(); in testServerSocketChannel() local 110 ssc.bind(null); in testServerSocketChannel() 113 ssc.close(); in testServerSocketChannel()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
D | ScannerTest.java | 335 ServerSocketChannel ssc = ServerSocketChannel.open(); in test_Constructor_LReadableByteChannel() local 336 ssc.socket().bind(null); in test_Constructor_LReadableByteChannel() 339 sc.connect(ssc.socket().getLocalSocketAddress()); in test_Constructor_LReadableByteChannel() 343 ssc.accept().close(); in test_Constructor_LReadableByteChannel() 344 ssc.close(); in test_Constructor_LReadableByteChannel()
|