jdk/test/java/nio/channels/AsynchronousChannelGroup/Unbounded.java
changeset 3632 399359a027de
parent 3327 82e069ae54ab
child 4234 d9720475ab15
equal deleted inserted replaced
3631:4dc04372d56b 3632:399359a027de
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
    21  * have any questions.
    22  */
    22  */
    23 
    23 
    24 /* @test
    24 /* @test
    25  * @bug 4607272
    25  * @bug 4607272 6842687
    26  * @summary Unit test for AsynchronousChannelGroup
    26  * @summary Unit test for AsynchronousChannelGroup
    27  */
    27  */
    28 
    28 
    29 import java.nio.ByteBuffer;
    29 import java.nio.ByteBuffer;
    30 import java.nio.channels.*;
    30 import java.nio.channels.*;
    49             public void completed(AsynchronousSocketChannel ch, Void att) {
    49             public void completed(AsynchronousSocketChannel ch, Void att) {
    50                 queue.add(ch);
    50                 queue.add(ch);
    51                 listener.accept((Void)null, this);
    51                 listener.accept((Void)null, this);
    52             }
    52             }
    53             public void failed(Throwable exc, Void att) {
    53             public void failed(Throwable exc, Void att) {
    54             }
       
    55             public void cancelled(Void att) {
       
    56             }
    54             }
    57         });
    55         });
    58         System.out.println("Listener created.");
    56         System.out.println("Listener created.");
    59 
    57 
    60         // establish lots of connections
    58         // establish lots of connections
    95                             throw new AssertionError(x);
    93                             throw new AssertionError(x);
    96                         }
    94                         }
    97                     }
    95                     }
    98                     public void failed(Throwable exc, AsynchronousSocketChannel ch) {
    96                     public void failed(Throwable exc, AsynchronousSocketChannel ch) {
    99                     }
    97                     }
   100                     public void cancelled(AsynchronousSocketChannel ch) {
       
   101                     }
       
   102                 });
    98                 });
   103         }
    99         }
   104         System.out.println("All read operations outstanding.");
   100         System.out.println("All read operations outstanding.");
   105 
   101 
   106         // write data to each of the accepted connections
   102         // write data to each of the accepted connections