Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4448894

AbstractSelectableChannel.configureBlocking() throws java.net.SocketException

XMLWordPrintable

    • beta
    • x86
    • windows_2000
    • Verified

      This failure occurs with Merlin b61 on windows platforms ( I tested with win98 , winNT and win2000 ).The same is passing with Merlin b60 on the above mentioned windows platforms.

      With Merlin b61 this is passing on solaris 7 and solaris 8.


      ----- testcode ----------

      try {
      Selector selector = Selector.open() ;

      java.nio.Pipe pipe = Pipe.open();
      Pipe.SourceChannel channel = pipe.source();

      // SocketChannel channel = SocketChannel.open() ;

      // isRegistered() should return false for newly created channel
      // since channel is not registered with any selector yet
      if (channel.isRegistered() != false) {
      return TestHelper.testFail(testName +
      " FAIL : isRegistered() didn't return false for newly created channel ! " + channel.isRegistered()) ;

      }

      // now, blocking mode should change
      channel.configureBlocking(false);

      // bug#4424026
      SelectionKey key = channel.register(selector,SelectionKey.OP_READ);
      //SelectionKey key = channel.register(selector,SelectionKey.OP_ACCEPT);


      // after registration, isRegistered() should return true
      if (!channel.isRegistered()) {
      return TestHelper.testFail(testName +
      " FAIL : isRegistered() expected to return true ! ") ;

      }

      } catch (Exception e) {
      return TestHelper.testFail(testName +
      " FAIL : unexpected Exception !", e) ;
      }




      -------Results---------

      java.net.SocketException: An operation was attempted on something that is not a socket
      at sun.nio.ch.IOUtil.configureBlocking(Native Method)
      at sun.nio.ch.SourceChannelImpl.implConfigureBlocking(SourceChannelImpl.java:46)
      at java.nio.spi.AbstractSelectableChannel.configureBlocking(AbstractSelectableChannel.java:221)
      at ASCregisterTest.registerTest(ASCregisterTest.java:145)
      at ASCregisterTest.go(ASCregisterTest.java:79)
      at ASCregisterTest.main(ASCregisterTest.java:43)

            mmcclosksunw Michael Mccloskey (Inactive)
            saksunw Sreejith Ak (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: