jdk/test/java/nio/channels/Selector/ReadAfterConnect.java
changeset 5798 9cc262cd2a7a
parent 5506 202f599c92aa
child 7668 d4a77089c587
equal deleted inserted replaced
5797:c2641f6791be 5798:9cc262cd2a7a
    35 
    35 
    36     public static void main(String[] argv) throws Exception {
    36     public static void main(String[] argv) throws Exception {
    37         ByteServer server = new ByteServer(0); // server: accept connection and do nothing
    37         ByteServer server = new ByteServer(0); // server: accept connection and do nothing
    38         server.start();
    38         server.start();
    39         InetSocketAddress isa = new InetSocketAddress(
    39         InetSocketAddress isa = new InetSocketAddress(
    40                 InetAddress.getByName(ByteServer.LOCALHOST), ByteServer.PORT);
    40                 InetAddress.getByName(ByteServer.LOCALHOST), server.port());
    41         Selector sel = Selector.open();
    41         Selector sel = Selector.open();
    42         SocketChannel sc = SocketChannel.open();
    42         SocketChannel sc = SocketChannel.open();
    43         sc.connect(isa);
    43         sc.connect(isa);
    44         sc.configureBlocking(false);
    44         sc.configureBlocking(false);
    45         sc.register(sel, SelectionKey.OP_READ);
    45         sc.register(sel, SelectionKey.OP_READ);