jdk/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java
changeset 2057 3acf8e5e2ca0
parent 1152 29d6145d1097
child 5506 202f599c92aa
equal deleted inserted replaced
2056:115e09b7a004 2057:3acf8e5e2ca0
     1 /*
     1 /*
     2  * Copyright 2007-2008 Sun Microsystems, Inc.  All Rights Reserved.
     2  * Copyright 2007-2009 Sun Microsystems, Inc.  All Rights Reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    46 
    46 
    47     public static void main(String[] args) throws IOException {
    47     public static void main(String[] args) throws IOException {
    48         ServerSocketChannel ssc = ServerSocketChannel.open();
    48         ServerSocketChannel ssc = ServerSocketChannel.open();
    49 
    49 
    50         // check supported options
    50         // check supported options
    51         Set<SocketOption<?>> options = ssc.options();
    51         Set<SocketOption<?>> options = ssc.supportedOptions();
    52         if (!options.contains(SO_REUSEADDR))
    52         if (!options.contains(SO_REUSEADDR))
    53             throw new RuntimeException("SO_REUSEADDR should be supported");
    53             throw new RuntimeException("SO_REUSEADDR should be supported");
    54         if (!options.contains(SO_RCVBUF))
    54         if (!options.contains(SO_RCVBUF))
    55             throw new RuntimeException("SO_RCVBUF should be supported");
    55             throw new RuntimeException("SO_RCVBUF should be supported");
    56 
    56