View Javadoc
1   /*
2    * Copyright 2011 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  package io.netty.channel.sctp;
17  
18  import com.sun.nio.sctp.SctpStandardSocketOptions.InitMaxStreams;
19  import io.netty.buffer.ByteBufAllocator;
20  import io.netty.channel.ChannelConfig;
21  import io.netty.channel.ChannelOption;
22  import io.netty.channel.MessageSizeEstimator;
23  import io.netty.channel.RecvByteBufAllocator;
24  
25  /**
26   * A {@link ChannelConfig} for a {@link SctpServerChannelConfig}.
27   * <p/>
28   * <h3>Available options</h3>
29   * <p/>
30   * In addition to the options provided by {@link ChannelConfig},
31   * {@link SctpServerChannelConfig} allows the following options in the
32   * option map:
33   * <p/>
34   * <table border="1" cellspacing="0" cellpadding="6">
35   * <tr>
36   * <th>Name</th><th>Associated setter method</th>
37   * </tr><tr>
38   * <td>{@link ChannelOption#SO_BACKLOG}</td><td>{@link #setBacklog(int)}</td>
39   * </tr><tr>
40   * <td>{@link ChannelOption#SO_RCVBUF}</td><td>{@link #setReceiveBufferSize(int)}</td>
41   * </tr><tr>
42   * <td>{@link ChannelOption#SO_SNDBUF}</td><td>{@link #setSendBufferSize(int)}</td>
43   * </tr><tr>
44   * <td>{@link SctpChannelOption#SCTP_INIT_MAXSTREAMS}</td><td>{@link #setInitMaxStreams(InitMaxStreams)}</td>
45   * </tr>
46   * </table>
47   */
48  public interface SctpServerChannelConfig extends ChannelConfig {
49  
50      /**
51       * Gets the backlog value to specify when the channel binds to a local address.
52       */
53      int getBacklog();
54  
55      /**
56       * Sets the backlog value to specify when the channel binds to a local address.
57       */
58      SctpServerChannelConfig setBacklog(int backlog);
59  
60      /**
61       * Gets the <a href="http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpStandardSocketOption.html">
62       *     {@code SO_SNDBUF}</a> option.
63       */
64      int getSendBufferSize();
65  
66      /**
67       * Sets the <a href="http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpStandardSocketOption.html">
68       *     {@code SO_SNDBUF}</a> option.
69       */
70      SctpServerChannelConfig setSendBufferSize(int sendBufferSize);
71  
72      /**
73       * Gets the <a href="http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpStandardSocketOption.html">
74       *     {@code SO_RCVBUF}</a> option.
75       */
76      int getReceiveBufferSize();
77  
78      /**
79       * Gets the <a href="http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpStandardSocketOption.html">
80       *     {@code SO_RCVBUF}</a> option.
81       */
82      SctpServerChannelConfig setReceiveBufferSize(int receiveBufferSize);
83  
84      /**
85       * Gets the <a href="http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpStandardSocketOption.html">
86       *     {@code SCTP_INIT_MAXSTREAMS}</a> option.
87       */
88      InitMaxStreams getInitMaxStreams();
89  
90      /**
91       * Gets the <a href="http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpStandardSocketOption.html">
92       *     {@code SCTP_INIT_MAXSTREAMS}</a> option.
93       */
94      SctpServerChannelConfig setInitMaxStreams(InitMaxStreams initMaxStreams);
95  
96      @Override
97      SctpServerChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead);
98  
99      @Override
100     SctpServerChannelConfig setWriteSpinCount(int writeSpinCount);
101 
102     @Override
103     SctpServerChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis);
104 
105     @Override
106     SctpServerChannelConfig setAllocator(ByteBufAllocator allocator);
107 
108     @Override
109     SctpServerChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator);
110 
111     @Override
112     SctpServerChannelConfig setAutoRead(boolean autoRead);
113 
114     @Override
115     SctpServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
116 
117     @Override
118     SctpServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
119 
120     @Override
121     SctpServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
122 }