Home
last modified time | relevance | path

Searched refs:sc (Results 1 – 25 of 32) sorted by relevance

12

/libcore/luni/src/test/java/libcore/java/nio/channels/
DSocketChannelTest.java52 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 …]
DSelectorTest.java42 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 …]
DServerSocketChannelTest.java172 ServerSocketChannel sc = ServerSocketChannel.open(); in test_setOption() local
173 sc.setOption(StandardSocketOptions.SO_REUSEADDR, true); in test_setOption()
176 assertTrue(sc.getOption(StandardSocketOptions.SO_REUSEADDR)); in test_setOption()
178 sc.setOption(StandardSocketOptions.SO_REUSEADDR, false); in test_setOption()
181 assertEquals(false, (boolean)sc.getOption(StandardSocketOptions.SO_REUSEADDR)); in test_setOption()
183 sc.setOption(StandardSocketOptions.SO_RCVBUF, 1100); in test_setOption()
184 assertTrue(1100 <= sc.getOption(StandardSocketOptions.SO_RCVBUF)); in test_setOption()
186 sc.close(); in test_setOption()
188 sc.setOption(StandardSocketOptions.SO_RCVBUF, 2000); in test_setOption()
DOldSocketChannelTest.java302 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/
DSocketAdaptor.java56 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 …]
DServerSocketAdaptor.java100 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()
DChannelInputStream.java53 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()
DPollArrayWrapper.java74 void addEntry(SelChImpl sc) { in addEntry() argument
75 putDescriptor(totalChannels, IOUtil.fdVal(sc.getFD())); in addEntry()
DServerSocketChannelImpl.java238 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()
DFileDispatcher.java59 abstract boolean canTransferToDirectly(SelectableChannel sc); in canTransferToDirectly() argument
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DSSLSessionContextTest.java25 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/
DAbstractSelectableChannelTest.java112 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/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
DSelectorTest.java116 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 …]
DSelectionKeyTest.java36 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()
DSinkChannelTest.java468 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()
DSocketChannelTest.java211 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 …]
DChannelsTest.java598 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()
DServerSocketChannelTest.java667 ServerSocketChannel sc = ServerSocketChannel.open(); in test_accept_SOTIMEOUT() local
669 sc.socket().bind(null); in test_accept_SOTIMEOUT()
672 sc.configureBlocking(false); in test_accept_SOTIMEOUT()
674 ServerSocket ss = sc.socket(); in test_accept_SOTIMEOUT()
685 SocketChannel client = sc.accept(); in test_accept_SOTIMEOUT()
690 sc.close(); in test_accept_SOTIMEOUT()
/libcore/ojluni/src/main/java/java/nio/channels/
DSocketChannel.java187 SocketChannel sc = open(); in open() local
189 sc.connect(remote); in open()
192 sc.close(); in open()
198 assert sc.isConnected(); in open()
199 return sc; in open()
DChannels.java95 SelectableChannel sc = (SelectableChannel)ch; in writeFully() local
96 synchronized (sc.blockingLock()) { in writeFully()
97 if (!sc.isBlocking()) in writeFully()
/libcore/ojluni/src/test/java/net/Socket/
DShutdownInput.java58 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/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/
DSecureCacheResponseTest.java35 SecureCacheResponse sc = new MockCacheResponse(); in testSecureCacheResponse() local
37 assertNull(sc.getCipherSuite()); in testSecureCacheResponse()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DPrintStreamTest.java243 char[] sc = new char[4000]; in test_print$C() local
244 fileString.getChars(0, fileString.length(), sc, 0); in test_print$C()
245 os.print(sc); in test_print$C()
413 char[] sc = new char[4000]; in test_println$C() local
414 fileString.getChars(0, fileString.length(), sc, 0); in test_println$C()
415 os.println(sc); in test_println$C()
/libcore/luni/src/test/java/libcore/java/io/
DSerializationTest.java110 SerializableContainer1 sc = (SerializableContainer1) SerializationTester.deserializeHex(s); in testDeserializeNullUnserializableField() local
111 assertNull(sc.unserializable); in testDeserializeNullUnserializableField()
/libcore/ojluni/src/main/java/java/util/concurrent/
DConcurrentHashMap.java2293 Node<K,V>[] tab; int sc; in initTable() local
2295 if ((sc = sizeCtl) < 0) in initTable()
2297 else if (U.compareAndSwapInt(this, SIZECTL, sc, -1)) { in initTable()
2300 int n = (sc > 0) ? sc : DEFAULT_CAPACITY; in initTable()
2304 sc = n - (n >>> 2); in initTable()
2307 sizeCtl = sc; in initTable()
2343 Node<K,V>[] tab, nt; int n, sc; in addCount() local
2344 while (s >= (long)(sc = sizeCtl) && (tab = table) != null && in addCount()
2347 if (sc < 0) { in addCount()
2348 if ((sc >>> RESIZE_STAMP_SHIFT) != rs || sc == rs + 1 || in addCount()
[all …]

12