harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-4212) [classlib][nio] deregistered channel.configureBlocking(true) throws IllegalBlockingModeException
Date Wed, 20 Jun 2007 13:17:26 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-4212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alexei Zakharov resolved HARMONY-4212.
--------------------------------------

    Resolution: Fixed

Thanks gentlemen, Mikhail's patch was applied at the revision 549100. Please verify it was
applied as expected and solves the original problem.

> [classlib][nio] deregistered channel.configureBlocking(true) throws IllegalBlockingModeException
> ------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4212
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4212
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Sergey Dmitriev
>            Assignee: Alexei Zakharov
>         Attachments: 4212workaround.patch, H-4212.patch
>
>
> In nio.channels: after deregistering and removing SocketChannel from selector calling
channel.configureBlocking(true) throws IllegalBlockingModeException. Actually this not how
it is have to be. Please see the mini test. (Please execute "telnet localhost 9999" in other
shell after test launch).
> ] guy@box ~
> ] cat select7.java
> import java.nio.channels.*;
> import java.net.*;
> import java.util.*;
> public class select7 {
>     public static void main(String[] args) throws Exception {
>         Selector selector = Selector.open();
>         ServerSocketChannel ssc = ServerSocketChannel.open();
>         ssc.socket().bind(new InetSocketAddress(9999));
>         // server listening
>         System.out.println("Waiting on accept...");
>         SocketChannel sc = ssc.accept();
>         System.out.println("Done.");
>         // register & select
>         sc.configureBlocking(false);
>         sc.register(selector, SelectionKey.OP_READ);
>         System.out.println("Waiting on select()...");
>         int res = selector.select();
>         System.out.println("Done. " + res + " key(s) up.");
>         // run through the selected keys
>         Iterator readyKeys = selector.selectedKeys().iterator();
>         while (readyKeys.hasNext()) {
>             SelectionKey key = (SelectionKey)readyKeys.next();
>             System.out.println("Selected key = " + key);
>             key.cancel();
>             readyKeys.remove();
>             SelectableChannel ch = key.channel();
>             ch.configureBlocking(true);
>         }
>     }
> }
> ] guy@box ~
> ] ~/jre2/bin/java -showversion select7
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or
its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r540000, (May 21 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Waiting on accept...
> Done.
> Waiting on select()...
> Done. 1 key(s) up.
> Selected key = org.apache.harmony.nio.internal.SelectionKeyImpl@4507d7e0
> Uncaught exception in main:
> java.nio.channels.IllegalBlockingModeException
>         at java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(AbstractSelectableChannel.java:206)
>         at select7.main(select7.java:39)
> ] guy@box ~
> ] java -showversion select7
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> BEA JRockit(R) (build R26.3.0-32-58710-1.5.0_06-20060308-2022-linux-ia32, )
> Waiting on accept...
> Done.
> Waiting on select()...
> Done. 1 key(s) up.
> Selected key = sun.nio.ch.SelectionKeyImpl@10e847b

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message