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