src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java

Print this page




  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package com.sun.nio.sctp;
  26 
  27 import java.net.SocketAddress;
  28 import sun.nio.ch.sctp.SctpStdSocketOption;
  29 
  30 /**
  31  * SCTP channels supports the socket options defined by this class
  32  * (as well as those listed in the particular channel class) and may support
  33  * additional Implementation specific socket options.
  34  *
  35  * @since 1.7
  36  */

  37 public class SctpStandardSocketOptions {
  38     private SctpStandardSocketOptions() {}
  39     /**
  40      * Enables or disables message fragmentation.
  41      *
  42      * <P> The value of this socket option is a {@code Boolean} that represents
  43      * whether the option is enabled or disabled. If enabled no SCTP message
  44      * fragmentation will be performed. Instead if a message being sent
  45      * exceeds the current PMTU size, the message will NOT be sent and
  46      * an error will be indicated to the user.
  47      *
  48      * <P> It is implementation specific whether or not this option is
  49      * supported.
  50      */
  51     public static final SctpSocketOption<Boolean> SCTP_DISABLE_FRAGMENTS = new
  52         SctpStdSocketOption<Boolean>("SCTP_DISABLE_FRAGMENTS", Boolean.class,
  53         sun.nio.ch.sctp.SctpStdSocketOption.SCTP_DISABLE_FRAGMENTS);
  54 
  55     /**
  56      * Enables or disables explicit message completion.


 298      * <p> The initial value of this socket option is a negative value, meaning
 299      * that the option is disabled. The option may be enabled, or the linger
 300      * interval changed, at any time. The maximum value of the linger interval
 301      * is system dependent. Setting the linger interval to a value that is
 302      * greater than its maximum value causes the linger interval to be set to
 303      * its maximum value.
 304      */
 305     public static final SctpSocketOption<Integer> SO_LINGER =
 306         new SctpStdSocketOption<Integer>("SO_LINGER", Integer.class,
 307         sun.nio.ch.sctp.SctpStdSocketOption.SO_LINGER);
 308 
 309     /**
 310      * This class is used to set the maximum number of inbound/outbound streams
 311      * used by the local endpoint during association initialization. An
 312      * instance of this class is used to set the {@link
 313      * SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS SCTP_INIT_MAXSTREAMS}
 314      * socket option.
 315      *
 316      * @since 1.7
 317      */

 318     public static class InitMaxStreams {
 319         private int maxInStreams;
 320         private int maxOutStreams;
 321 
 322         private InitMaxStreams(int maxInStreams, int maxOutStreams) {
 323            this.maxInStreams = maxInStreams;
 324            this.maxOutStreams = maxOutStreams;
 325         }
 326 
 327         /**
 328          * Creates an InitMaxStreams instance.
 329          *
 330          * @param  maxInStreams
 331          *         The maximum number of inbound streams, where
 332          *         {@code 0 <= maxInStreams <= 65536}
 333          *
 334          * @param  maxOutStreams
 335          *         The maximum number of outbound streams, where
 336          *         {@code 0 <= maxOutStreams <= 65536}
 337          *




  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package com.sun.nio.sctp;
  26 
  27 import java.net.SocketAddress;
  28 import sun.nio.ch.sctp.SctpStdSocketOption;
  29 
  30 /**
  31  * SCTP channels supports the socket options defined by this class
  32  * (as well as those listed in the particular channel class) and may support
  33  * additional Implementation specific socket options.
  34  *
  35  * @since 1.7
  36  */
  37 @jdk.Supported
  38 public class SctpStandardSocketOptions {
  39     private SctpStandardSocketOptions() {}
  40     /**
  41      * Enables or disables message fragmentation.
  42      *
  43      * <P> The value of this socket option is a {@code Boolean} that represents
  44      * whether the option is enabled or disabled. If enabled no SCTP message
  45      * fragmentation will be performed. Instead if a message being sent
  46      * exceeds the current PMTU size, the message will NOT be sent and
  47      * an error will be indicated to the user.
  48      *
  49      * <P> It is implementation specific whether or not this option is
  50      * supported.
  51      */
  52     public static final SctpSocketOption<Boolean> SCTP_DISABLE_FRAGMENTS = new
  53         SctpStdSocketOption<Boolean>("SCTP_DISABLE_FRAGMENTS", Boolean.class,
  54         sun.nio.ch.sctp.SctpStdSocketOption.SCTP_DISABLE_FRAGMENTS);
  55 
  56     /**
  57      * Enables or disables explicit message completion.


 299      * <p> The initial value of this socket option is a negative value, meaning
 300      * that the option is disabled. The option may be enabled, or the linger
 301      * interval changed, at any time. The maximum value of the linger interval
 302      * is system dependent. Setting the linger interval to a value that is
 303      * greater than its maximum value causes the linger interval to be set to
 304      * its maximum value.
 305      */
 306     public static final SctpSocketOption<Integer> SO_LINGER =
 307         new SctpStdSocketOption<Integer>("SO_LINGER", Integer.class,
 308         sun.nio.ch.sctp.SctpStdSocketOption.SO_LINGER);
 309 
 310     /**
 311      * This class is used to set the maximum number of inbound/outbound streams
 312      * used by the local endpoint during association initialization. An
 313      * instance of this class is used to set the {@link
 314      * SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS SCTP_INIT_MAXSTREAMS}
 315      * socket option.
 316      *
 317      * @since 1.7
 318      */
 319     @jdk.Supported
 320     public static class InitMaxStreams {
 321         private int maxInStreams;
 322         private int maxOutStreams;
 323 
 324         private InitMaxStreams(int maxInStreams, int maxOutStreams) {
 325            this.maxInStreams = maxInStreams;
 326            this.maxOutStreams = maxOutStreams;
 327         }
 328 
 329         /**
 330          * Creates an InitMaxStreams instance.
 331          *
 332          * @param  maxInStreams
 333          *         The maximum number of inbound streams, where
 334          *         {@code 0 <= maxInStreams <= 65536}
 335          *
 336          * @param  maxOutStreams
 337          *         The maximum number of outbound streams, where
 338          *         {@code 0 <= maxOutStreams <= 65536}
 339          *