src/java.base/unix/classes/java/net/PlainDatagramSocketImpl.java
changeset 53419 eac105e3ec13
parent 50303 7164c3bb55df
child 55081 dd321e3596c0
equal deleted inserted replaced
53418:bc2bb4eee477 53419:eac105e3ec13
     1 /*
     1 /*
     2  * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2007, 2019, Oracle and/or its affiliates. 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.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    26 
    26 
    27 import java.io.IOException;
    27 import java.io.IOException;
    28 import java.util.Set;
    28 import java.util.Set;
    29 import java.util.HashSet;
    29 import java.util.HashSet;
    30 import sun.net.ext.ExtendedSocketOptions;
    30 import sun.net.ext.ExtendedSocketOptions;
    31 import static sun.net.ext.ExtendedSocketOptions.SOCK_DGRAM;
       
    32 
    31 
    33 /*
    32 /*
    34  * On Unix systems we simply delegate to native methods.
    33  * On Unix systems we simply delegate to native methods.
    35  *
    34  *
    36  * @author Chris Hegarty
    35  * @author Chris Hegarty
    76         }
    75         }
    77     }
    76     }
    78 
    77 
    79     protected Set<SocketOption<?>> supportedOptions() {
    78     protected Set<SocketOption<?>> supportedOptions() {
    80         HashSet<SocketOption<?>> options = new HashSet<>(super.supportedOptions());
    79         HashSet<SocketOption<?>> options = new HashSet<>(super.supportedOptions());
    81         options.addAll(ExtendedSocketOptions.options(SOCK_DGRAM));
    80         options.addAll(ExtendedSocketOptions.datagramSocketOptions());
    82         return options;
    81         return options;
    83     }
    82     }
    84 
    83 
    85     protected void socketSetOption(int opt, Object val) throws SocketException {
    84     protected void socketSetOption(int opt, Object val) throws SocketException {
    86         if (opt == SocketOptions.SO_REUSEPORT &&
    85         if (opt == SocketOptions.SO_REUSEPORT &&