jdk/test/java/nio/channels/SocketChannel/Shutdown.java
changeset 9679 d98ae8bc45fc
parent 5506 202f599c92aa
child 14342 8435a30053c1
equal deleted inserted replaced
9677:638762c0263e 9679:d98ae8bc45fc
    37      * Accept a connection, and close it immediately causing a hard reset.
    37      * Accept a connection, and close it immediately causing a hard reset.
    38      */
    38      */
    39     static void acceptAndReset(ServerSocketChannel ssc) throws IOException {
    39     static void acceptAndReset(ServerSocketChannel ssc) throws IOException {
    40         SocketChannel peer = ssc.accept();
    40         SocketChannel peer = ssc.accept();
    41         try {
    41         try {
    42             peer.setOption(StandardSocketOption.SO_LINGER, 0);
    42             peer.setOption(StandardSocketOptions.SO_LINGER, 0);
    43             peer.configureBlocking(false);
    43             peer.configureBlocking(false);
    44             peer.write(ByteBuffer.wrap(new byte[128*1024]));
    44             peer.write(ByteBuffer.wrap(new byte[128*1024]));
    45         } finally {
    45         } finally {
    46             peer.close();
    46             peer.close();
    47         }
    47         }