< prev index next >

test/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoService.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 53,66 **** * * The service closes the inherited network channel when complete. To * facilate testing that the channel is closed the "tcp nowait" service * can close the connection after a given number of bytes. */ - import java.nio.*; - import java.nio.channels.*; import java.io.IOException; ! import java.net.*; public class EchoService { private static void doIt(SocketChannel sc, int closeAfter, int delay) throws IOException { ByteBuffer bb = ByteBuffer.allocate(1024); --- 53,71 ---- * * The service closes the inherited network channel when complete. To * facilate testing that the channel is closed the "tcp nowait" service * can close the connection after a given number of bytes. */ import java.io.IOException; ! import java.net.SocketAddress; ! import java.nio.ByteBuffer; ! import java.nio.channels.Channel; ! import java.nio.channels.DatagramChannel; ! import java.nio.channels.SelectionKey; ! import java.nio.channels.Selector; ! import java.nio.channels.ServerSocketChannel; ! import java.nio.channels.SocketChannel; public class EchoService { private static void doIt(SocketChannel sc, int closeAfter, int delay) throws IOException { ByteBuffer bb = ByteBuffer.allocate(1024);
< prev index next >