/libcore/luni/src/test/java/libcore/java/nio/channels/ |
D | SocketChannelTest.java | 52 SocketChannel sc = SocketChannel.open(ss.getLocalSocketAddress())) { in test_read_intoReadOnlyByteArrays() 56 sc.read(readOnly); in test_read_intoReadOnlyByteArrays() 61 sc.read(new ByteBuffer[] { readOnly }); in test_read_intoReadOnlyByteArrays() 66 sc.read(new ByteBuffer[] { readOnly }, 0, 1); in test_read_intoReadOnlyByteArrays() 75 SocketChannel sc = SocketChannel.open(); in test_56684() local 76 sc.configureBlocking(false); in test_56684() 79 SelectionKey selectionKey = sc.register(selector, SelectionKey.OP_CONNECT); in test_56684() 87 sc.connect(new InetSocketAddress(InetAddress.getByAddress(new byte[] { in test_56684() 94 sc.finishConnect(); in test_56684() 104 SocketChannel sc = SocketChannel.open(ss.getLocalSocketAddress()); in test_channelSocketOutputStreamClosureState() local [all …]
|
D | SelectorTest.java | 42 SocketChannel sc = SocketChannel.open(); in testNonBlockingConnect_immediate() local 43 sc.configureBlocking(false); in testNonBlockingConnect_immediate() 44 sc.connect(ssc.socket().getLocalSocketAddress()); in testNonBlockingConnect_immediate() 45 SelectionKey key = sc.register(selector, SelectionKey.OP_CONNECT); in testNonBlockingConnect_immediate() 48 sc.finishConnect(); in testNonBlockingConnect_immediate() 118 SocketChannel sc = SocketChannel.open(); in test_57456() local 119 sc.connect(ssc.socket().getLocalSocketAddress()); in test_57456() 120 sc.finishConnect(); in test_57456() 123 sc.configureBlocking(false); in test_57456() 130 SelectionKey key = sc.register(selector, in test_57456() [all …]
|
D | ServerSocketChannelTest.java | 243 ServerSocketChannel sc = ServerSocketChannel.open(); in set_option() local 244 sc.setOption(StandardSocketOptions.SO_REUSEADDR, true); in set_option() 247 assertTrue(sc.getOption(StandardSocketOptions.SO_REUSEADDR)); in set_option() 249 sc.setOption(StandardSocketOptions.SO_REUSEADDR, false); in set_option() 252 assertEquals(false, (boolean)sc.getOption(StandardSocketOptions.SO_REUSEADDR)); in set_option() 254 sc.setOption(StandardSocketOptions.SO_RCVBUF, 1100); in set_option() 255 assertTrue(1100 <= sc.getOption(StandardSocketOptions.SO_RCVBUF)); in set_option() 257 sc.close(); in set_option() 259 sc.setOption(StandardSocketOptions.SO_RCVBUF, 2000); in set_option()
|
D | OldSocketChannelTest.java | 302 SocketChannel sc = SocketChannel.open(); in test_socketChannel_read_DirectByteBuffer() local 303 sc.connect(ssc.socket().getLocalSocketAddress()); in test_socketChannel_read_DirectByteBuffer() 307 sc.read(buf); in test_socketChannel_read_DirectByteBuffer() 310 sc.read(buf); in test_socketChannel_read_DirectByteBuffer() 311 sc.close(); in test_socketChannel_read_DirectByteBuffer() 318 sc = SocketChannel.open(); in test_socketChannel_read_DirectByteBuffer() 319 sc.connect(ssc.socket().getLocalSocketAddress()); in test_socketChannel_read_DirectByteBuffer() 323 sc.read(buf); in test_socketChannel_read_DirectByteBuffer() 326 sc.read(buf); in test_socketChannel_read_DirectByteBuffer() 327 sc.close(); in test_socketChannel_read_DirectByteBuffer()
|
/libcore/ojluni/src/main/java/sun/nio/ch/ |
D | SocketAdaptor.java | 56 private final SocketChannelImpl sc; field in SocketAdaptor 61 private SocketAdaptor(SocketChannelImpl sc) throws SocketException { in SocketAdaptor() argument 63 super(new FileDescriptorHolderSocketImpl(sc.getFD())); in SocketAdaptor() 64 this.sc = sc; in SocketAdaptor() 67 public static Socket create(SocketChannelImpl sc) { in create() argument 69 return new SocketAdaptor(sc); in create() 76 return sc; in getChannel() 91 synchronized (sc.blockingLock()) { in connect() 92 if (!sc.isBlocking()) in connect() 101 sc.connect(remote); in connect() [all …]
|
D | ServerSocketAdaptor.java | 100 SocketChannel sc = ssc.accept(); in accept() local 101 if (sc == null && !ssc.isBlocking()) in accept() 103 return sc.socket(); in accept() 108 SocketChannel sc; in accept() local 109 if ((sc = ssc.accept()) != null) in accept() 110 return sc.socket(); in accept() 117 if (result > 0 && ((sc = ssc.accept()) != null)) in accept() 118 return sc.socket(); in accept()
|
D | ChannelInputStream.java | 53 SelectableChannel sc = (SelectableChannel)ch; in read() local 54 synchronized (sc.blockingLock()) { in read() 55 boolean bm = sc.isBlocking(); in read() 59 sc.configureBlocking(block); in read() 62 sc.configureBlocking(bm); in read()
|
D | PollArrayWrapper.java | 74 void addEntry(SelChImpl sc) { in addEntry() argument 75 putDescriptor(totalChannels, IOUtil.fdVal(sc.getFD())); in addEntry()
|
D | ServerSocketChannelImpl.java | 238 SocketChannel sc = null; in accept() local 266 sc = new SocketChannelImpl(provider(), newfd, isa); in accept() 273 sc.close(); in accept() 277 return sc; in accept()
|
D | FileDispatcher.java | 59 abstract boolean canTransferToDirectly(SelectableChannel sc); in canTransferToDirectly() argument
|
/libcore/ojluni/src/test/java/util/Scanner/ |
D | ScanTest.java | 130 try (Scanner sc = new Scanner(inputStream())) { in useCase1() argument 131 sc.findWithinHorizon("usage case 1", 0); in useCase1() 134 while (sc.hasNextFloat()) in useCase1() 135 sc.nextFloat(); in useCase1() 136 names[i] = sc.next(); in useCase1() 137 sc.nextLine(); in useCase1() 152 try (Scanner sc = new Scanner(inputStream()).useDelimiter("-")) { in useCase2() argument 153 String testDataTag = sc.findWithinHorizon("usage case 2\n", 0); in useCase2() 156 if (!sc.next().equals("cat")) in useCase2() 158 if (sc.nextInt() != 9) in useCase2() [all …]
|
D | ScannerStreamTest.java | 80 Scanner sc = new Scanner(input); in makeScanner() local 82 sc.useDelimiter(delimiter); in makeScanner() 84 return sc; in makeScanner() 94 Scanner sc = makeScanner(input, delimiter); in tokensTest() local 96 while (sc.hasNext()) { in tokensTest() 97 expected.add(sc.next()); in tokensTest() 134 try (Scanner sc = makeResourceScanner()) { in findAllFileTest() argument 136 while ((match = sc.findWithinHorizon(pat, 0)) != null) { in findAllFileTest()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/ |
D | SSLSessionContextTest.java | 25 SSLSessionContext sc = context in test_sessionCacheSize() local 27 sc.setSessionCacheSize(10); in test_sessionCacheSize() 28 assertEquals("10 wasn't returned", 10, sc.getSessionCacheSize()); in test_sessionCacheSize() 29 sc.setSessionCacheSize(5); in test_sessionCacheSize() 30 assertEquals("5 wasn't returned", 5, sc.getSessionCacheSize()); in test_sessionCacheSize() 33 sc.setSessionCacheSize(-1); in test_sessionCacheSize() 49 SSLSessionContext sc = context in test_sessionTimeout() local 51 sc.setSessionTimeout(100); in test_sessionTimeout() 52 assertEquals("100 wasn't returned", 100, sc.getSessionTimeout()); in test_sessionTimeout() 53 sc.setSessionTimeout(5000); in test_sessionTimeout() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/spi/ |
D | AbstractSelectableChannelTest.java | 112 SocketChannel sc = SocketChannel.open(); in test_register_LSelectorILObject() local 113 sc.configureBlocking(false); in test_register_LSelectorILObject() 114 SelectionKey acceptKey = sc.register(acceptSelector1, in test_register_LSelectorILObject() 118 assertSame(sc, acceptKey.channel()); in test_register_LSelectorILObject() 121 acceptKey = sc.register(acceptSelector2, SelectionKey.OP_READ, null); in test_register_LSelectorILObject() 211 SocketChannel sc = SocketChannel.open(); in test_register_LSelectorILObject_IllegalArgument() local 212 sc.configureBlocking(false); in test_register_LSelectorILObject_IllegalArgument() 214 sc.register(null, SelectionKey.OP_READ, argObj); in test_register_LSelectorILObject_IllegalArgument() 235 SocketChannel sc = SocketChannel.open(); in test_keyfor_LSelector() local 237 sc.configureBlocking(false); in test_keyfor_LSelector() [all …]
|
/libcore/ojluni/src/test/java/nio/channels/Selector/ |
D | SelectAfterRead.java | 47 SocketChannel sc = SocketChannel.open(server.address())) { in testSelectAfterRead() 53 sc.read(ByteBuffer.allocate(1)); in testSelectAfterRead() 54 sc.configureBlocking(false); in testSelectAfterRead() 55 sc.register(sel, SelectionKey.OP_READ); in testSelectAfterRead() 66 SocketChannel sc = SocketChannel.open(server.address())) { in testSelectAfterRead() 72 sc.configureBlocking(false); in testSelectAfterRead() 73 sc.register(sel, SelectionKey.OP_READ); in testSelectAfterRead() 83 if (sc.read(ByteBuffer.allocate(1)) != 1) in testSelectAfterRead() 85 if (sc.read(ByteBuffer.allocate(1)) != 1) in testSelectAfterRead()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/ |
D | SelectorTest.java | 116 SocketChannel sc = SocketChannel.open(); in test_keys() local 117 sc.configureBlocking(false); in test_keys() 118 SelectionKey key3 = sc.register(selector, SelectionKey.OP_READ); in test_keys() 151 SocketChannel sc = SocketChannel.open(); in test_selectedKeys() local 155 sc.connect(localAddress); in test_selectedKeys() 188 sc.close(); in test_selectedKeys() 337 SocketChannel sc = SocketChannel.open(); 338 sc.configureBlocking(false); 339 SelectionKey key2 = sc.register(selector, SelectionKey.OP_READ); 394 SocketChannel sc = SocketChannel.open(); [all …]
|
D | SelectionKeyTest.java | 36 SocketChannel sc; field in SelectionKeyTest 45 sc = SocketChannel.open(); in setUp() 46 sc.configureBlocking(false); in setUp() 47 selectionKey = sc.register(selector, SelectionKey.OP_CONNECT); in setUp() 127 assertSame(sc, selectionKey.channel()); in test_channel() 130 assertSame(sc, selectionKey.channel()); in test_channel() 155 selectionKey.interestOps(~sc.validOps()); in test_interestOpsI() 188 sc.close(); in test_isValid_ChannelColsed() 298 sc.connect(new InetSocketAddress(LOCAL_ADDR, ss.getLocalPort())); in test_readyOps()
|
D | SinkChannelTest.java | 468 SocketChannel sc = SocketChannel.open(); in test_socketChannel_read_close() local 471 sc.write(buf); in test_socketChannel_read_close() 476 sc.connect(new InetSocketAddress(InetAddress.getLocalHost(), localPort)); in test_socketChannel_read_close() 479 sc.close(); in test_socketChannel_read_close() 481 sc.write(buf); in test_socketChannel_read_close() 493 SocketChannel sc = SocketChannel.open(); in test_socketChannel_read_write() local 494 sc.connect(new InetSocketAddress(InetAddress.getLocalHost(), localPort)); in test_socketChannel_read_write() 498 sc.write(buf,0,2); in test_socketChannel_read_write() 503 sc.close(); in test_socketChannel_read_write()
|
D | SocketChannelTest.java | 211 SocketChannel sc = SocketChannel.open(); in test_getLocalSocketAddress_afterClose() local 212 assertNull(sc.socket().getLocalSocketAddress()); in test_getLocalSocketAddress_afterClose() 215 sc.socket().bind(bindAddr); in test_getLocalSocketAddress_afterClose() 217 assertNotNull(sc.socket().getLocalSocketAddress()); in test_getLocalSocketAddress_afterClose() 219 sc.close(); in test_getLocalSocketAddress_afterClose() 221 assertFalse(sc.isOpen()); in test_getLocalSocketAddress_afterClose() 223 sc.socket().getLocalSocketAddress(); in test_getLocalSocketAddress_afterClose() 2644 MockSocketChannel sc = new MockSocketChannel(null); in test_read$LByteBuffer() local 2649 sc.read(byteBufferArray); in test_read$LByteBuffer() 2650 assertTrue(sc.isReadCalled); in test_read$LByteBuffer() [all …]
|
D | ChannelsTest.java | 598 SocketChannel sc = SocketChannel.open(); in test_newReader_LReadableByteChannel_LString() local 599 sc.connect(ssc.socket().getLocalSocketAddress()); in test_newReader_LReadableByteChannel_LString() 600 sc.configureBlocking(false); in test_newReader_LReadableByteChannel_LString() 601 assertFalse(sc.isBlocking()); in test_newReader_LReadableByteChannel_LString() 605 assertFalse(sc.isBlocking()); in test_newReader_LReadableByteChannel_LString() 607 Reader reader = Channels.newReader(sc, "UTF16"); in test_newReader_LReadableByteChannel_LString() 615 Channels.newInputStream(sc).read(); in test_newReader_LReadableByteChannel_LString() 620 sc.close(); in test_newReader_LReadableByteChannel_LString()
|
/libcore/ojluni/src/main/java/java/nio/channels/ |
D | SocketChannel.java | 192 SocketChannel sc = open(); in open() local 194 sc.connect(remote); in open() 197 sc.close(); in open() 203 assert sc.isConnected(); in open() 204 return sc; in open()
|
/libcore/ojluni/src/test/java/nio/channels/SelectionKey/ |
D | AtomicUpdates.java | 54 private SelectionKey keyFor(SocketChannel sc) { in keyFor() argument 64 return sc; in keyFor() 169 try (SocketChannel sc = SocketChannel.open()) { in testDefaultImplementation() argument 170 SelectionKey key = keyFor(sc); in testDefaultImplementation() 179 try (SocketChannel sc = SocketChannel.open(); in testNioImplementation() argument 181 sc.configureBlocking(false); in testNioImplementation() 182 SelectionKey key = sc.register(sel, 0); in testNioImplementation()
|
/libcore/ojluni/src/test/java/net/Socket/ |
D | ShutdownInput.java | 58 try (ServerSocketChannel sc = ServerSocketChannel.open().bind(null); in main() argument 60 new InetSocketAddress(iaddr, sc.socket().getLocalPort())); in main() 61 SocketChannel s2 = sc.accept() ) { in main()
|
/libcore/ojluni/src/test/java/util/Collections/ |
D | UnmodifiableMapEntrySet.java | 145 … Function<Spliterator<Map.Entry<Integer, Integer>>, Consumer<EntryConsumer>> sc) { in testSpliterator() argument 146 testWithEntryConsumer(sc.apply(ss.get())); in testSpliterator() 151 testWithEntryConsumer(sc.apply(split)); in testSpliterator() 152 testWithEntryConsumer(sc.apply(s)); in testSpliterator()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/ |
D | SecureCacheResponseTest.java | 35 SecureCacheResponse sc = new MockCacheResponse(); in testSecureCacheResponse() local 37 assertNull(sc.getCipherSuite()); in testSecureCacheResponse()
|