Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/sun/nio/ch/sctp/SctpStdSocketOption.java
38919 views
/*1* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/24package sun.nio.ch.sctp;2526import com.sun.nio.sctp.SctpSocketOption;27import java.lang.annotation.Native;2829public class SctpStdSocketOption<T>30implements SctpSocketOption<T>31{32/* for native mapping of int options */33@Native public static final int SCTP_DISABLE_FRAGMENTS = 1;34@Native public static final int SCTP_EXPLICIT_COMPLETE = 2;35@Native public static final int SCTP_FRAGMENT_INTERLEAVE = 3;36@Native public static final int SCTP_NODELAY = 4;37@Native public static final int SO_SNDBUF = 5;38@Native public static final int SO_RCVBUF = 6;39@Native public static final int SO_LINGER = 7;4041private final String name;42private final Class<T> type;4344/* for native mapping of int options */45private int constValue;4647public SctpStdSocketOption(String name, Class<T> type) {48this.name = name;49this.type = type;50}5152public SctpStdSocketOption(String name, Class<T> type, int constValue) {53this.name = name;54this.type = type;55this.constValue = constValue;56}5758@Override59public String name() {60return name;61}6263@Override64public Class<T> type() {65return type;66}6768@Override69public String toString() {70return name;71}7273int constValue() {74return constValue;75}76}777879