Home
last modified time | relevance | path

Searched refs:sc (Results 1 – 25 of 28) 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
DFileDispatcherImpl.java138 boolean canTransferToDirectly(java.nio.channels.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()
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/luni/src/test/java/org/apache/harmony/security/tests/java/security/
DSignatureTest.java89 MySignature sc = new MySignature(); in testClone() local
91 sc.clone(); in testClone()

12