Name: nt126004 Date: 12/04/2001
java version "1.4.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed mode)
To duplicate bug:
Compile appended code, and run. First message shows up,
but second message does not. This only happens on Win32.
Sometimes, after close to an hour, the second message will
appear.
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.nio.channels.SelectionKey;
import java.net.InetSocketAddress;
import java.io.IOException;
public class bug
{
public static void main(String a[])
throws IOException
{
Selector select = Selector.open();
SocketChannel sc =
SocketChannel.open
(new InetSocketAddress("java.sun.com", 80));
sc.configureBlocking(false);
sc.register(select, SelectionKey.OP_WRITE);
System.out.println("Waiting to be able to write to java.sun.com:80");
select.select();
System.out.println("Select returns once");
select.select();
System.out.println("Select returns twice");
sc.close();
}
}
(Review ID: 136324)
======================================================================
- duplicates
-
JDK-4592971 java.nio spec corner cases
-
- Closed
-