1.4 Build B-54
----------- test code ------------
try {
Selector pipeSelector = Selector.open() ;
Pipe pipe = Pipe.open();
Pipe.SourceChannel sourceChannel = pipe.source();
sourceChannel.configureBlocking(false);
System.out.println("Configured to nonblocking mode. isBlocking()= " + sourceChannel.isBlocking());
SelectionKey pipeKey = sourceChannel.register(pipeSelector,
SelectionKey.OP_READ);
System.out.println("isRegistered()= " + sourceChannel.isRegistered());
} catch (Exception e) {
System.out.println("FAIL : unexpected Exception ! ");
e.printStackTrace() ;
}
---------- results --------------
FAIL : unexpected Exception !
java.lang.ClassCastException: sun.nio.ch.SourceChannelImpl
at sun.nio.ch.SelectorImpl.register(SelectorImpl.java:179)
at java.nio.spi.AbstractSelectableChannel.register(AbstractSelectableChannel.java:150)
:
:
----------- test code ------------
try {
Selector pipeSelector = Selector.open() ;
Pipe pipe = Pipe.open();
Pipe.SourceChannel sourceChannel = pipe.source();
sourceChannel.configureBlocking(false);
System.out.println("Configured to nonblocking mode. isBlocking()= " + sourceChannel.isBlocking());
SelectionKey pipeKey = sourceChannel.register(pipeSelector,
SelectionKey.OP_READ);
System.out.println("isRegistered()= " + sourceChannel.isRegistered());
} catch (Exception e) {
System.out.println("FAIL : unexpected Exception ! ");
e.printStackTrace() ;
}
---------- results --------------
FAIL : unexpected Exception !
java.lang.ClassCastException: sun.nio.ch.SourceChannelImpl
at sun.nio.ch.SelectorImpl.register(SelectorImpl.java:179)
at java.nio.spi.AbstractSelectableChannel.register(AbstractSelectableChannel.java:150)
:
:
- relates to
-
JDK-4448894 AbstractSelectableChannel.configureBlocking() throws java.net.SocketException
-
- Closed
-