jdk/test/java/nio/channels/AsynchronousChannelGroup/Identity.java
changeset 3327 82e069ae54ab
parent 2057 3acf8e5e2ca0
child 3632 399359a027de
equal deleted inserted replaced
3326:31a5302fe6d4 3327:82e069ae54ab
    76     public static void main(String[] args) throws Exception {
    76     public static void main(String[] args) throws Exception {
    77         // create listener to accept connections
    77         // create listener to accept connections
    78         final AsynchronousServerSocketChannel listener =
    78         final AsynchronousServerSocketChannel listener =
    79             AsynchronousServerSocketChannel.open()
    79             AsynchronousServerSocketChannel.open()
    80                 .bind(new InetSocketAddress(0));
    80                 .bind(new InetSocketAddress(0));
    81         listener.accept(null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
    81         listener.accept((Void)null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
    82             public void completed(final AsynchronousSocketChannel ch, Void att) {
    82             public void completed(final AsynchronousSocketChannel ch, Void att) {
    83                 listener.accept(null, this);
    83                 listener.accept((Void)null, this);
    84 
    84 
    85                 final ByteBuffer buf = ByteBuffer.allocate(100);
    85                 final ByteBuffer buf = ByteBuffer.allocate(100);
    86                 ch.read(buf, null, new CompletionHandler<Integer,Void>() {
    86                 ch.read(buf, (Void)null, new CompletionHandler<Integer,Void>() {
    87                     public void completed(Integer bytesRead, Void att) {
    87                     public void completed(Integer bytesRead, Void att) {
    88                         buf.clear();
    88                         buf.clear();
    89                         ch.read(buf, null, this);
    89                         ch.read(buf, (Void)null, this);
    90                     }
    90                     }
    91                     public void failed(Throwable exc, Void att) {
    91                     public void failed(Throwable exc, Void att) {
    92                     }
    92                     }
    93                     public void cancelled(Void att) {
    93                     public void cancelled(Void att) {
    94                     }
    94                     }