< prev index next >
test/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoTest.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2003, 2010, 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.
*** 33,46 ****
* The second test is a UDP echo test. A service is launched with a UDP
* socket and a UDP packet is sent to the service. The test checks that
* the packet is correctly echoed.
*
*/
! import java.net.*;
! import java.io.*;
import java.nio.ByteBuffer;
! import java.nio.channels.*;
import java.util.Random;
public class EchoTest {
private static int failures = 0;
--- 33,49 ----
* The second test is a UDP echo test. A service is launched with a UDP
* socket and a UDP packet is sent to the service. The test checks that
* the packet is correctly echoed.
*
*/
! import java.io.IOException;
! import java.net.DatagramPacket;
import java.nio.ByteBuffer;
! import java.nio.channels.DatagramChannel;
! import java.nio.channels.SelectionKey;
! import java.nio.channels.Selector;
! import java.nio.channels.SocketChannel;
import java.util.Random;
public class EchoTest {
private static int failures = 0;
< prev index next >