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  import io.netty.channel.WriteBufferWaterMark;
25  
26  /**
27   * A {@link ChannelConfig} for a {@link SctpServerChannelConfig}.
28   * <p/>
29   * <h3>Available options</h3>
30   * <p/>
31   * In addition to the options provided by {@link ChannelConfig},
32   * {@link SctpServerChannelConfig} allows the following options in the
33   * option map:
34   * <p/>
35   * <table border="1" cellspacing="0" cellpadding="6">
36   * <tr>
37   * <th>Name</th><th>Associated setter method</th>
38   * </tr><tr>
39   * <td>{@link ChannelOption#SO_BACKLOG}</td><td>{@link #setBacklog(int)}</td>
40   * </tr><tr>
41   * <td>{@link ChannelOption#SO_RCVBUF}</td><td>{@link #setReceiveBufferSize(int)}</td>
42   * </tr><tr>
43   * <td>{@link ChannelOption#SO_SNDBUF}</td><td>{@link #setSendBufferSize(int)}</td>
44   * </tr><tr>
45   * <td>{@link SctpChannelOption#SCTP_INIT_MAXSTREAMS}</td><td>{@link #setInitMaxStreams(InitMaxStreams)}</td>
46   * </tr>
47   * </table>
48   */
49  public interface SctpServerChannelConfig extends ChannelConfig {
50  
51      /**
52       * Gets the backlog value to specify when the channel binds to a local address.
53       */
54      int getBacklog();
55  
56      /**
57       * Sets the backlog value to specify when the channel binds to a local address.
58       */
59      SctpServerChannelConfig setBacklog(int backlog);
60  
61      /**
62       * Gets the <a href="http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpStandardSocketOption.html">
63       *     {@code SO_SNDBUF}</a> option.
64       */
65      int getSendBufferSize();
66  
67      /**
68       * Sets the <a href="http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpStandardSocketOption.html">
69       *     {@code SO_SNDBUF}</a> option.
70       */
71      SctpServerChannelConfig setSendBufferSize(int sendBufferSize);
72  
73      /**
74       * Gets the <a href="http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpStandardSocketOption.html">
75       *     {@code SO_RCVBUF}</a> option.
76       */
77      int getReceiveBufferSize();
78  
79      /**
80       * Gets the <a href="http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpStandardSocketOption.html">
81       *     {@code SO_RCVBUF}</a> option.
82       */
83      SctpServerChannelConfig setReceiveBufferSize(int receiveBufferSize);
84  
85      /**
86       * Gets the <a href="http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpStandardSocketOption.html">
87       *     {@code SCTP_INIT_MAXSTREAMS}</a> option.
88       */
89      InitMaxStreams getInitMaxStreams();
90  
91      /**
92       * Gets the <a href="http://openjdk.java.net/projects/sctp/javadoc/com/sun/nio/sctp/SctpStandardSocketOption.html">
93       *     {@code SCTP_INIT_MAXSTREAMS}</a> option.
94       */
95      SctpServerChannelConfig setInitMaxStreams(InitMaxStreams initMaxStreams);
96  
97      @Override
98      @Deprecated
99      SctpServerChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead);
100 
101     @Override
102     SctpServerChannelConfig setWriteSpinCount(int writeSpinCount);
103 
104     @Override
105     SctpServerChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis);
106 
107     @Override
108     SctpServerChannelConfig setAllocator(ByteBufAllocator allocator);
109 
110     @Override
111     SctpServerChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator);
112 
113     @Override
114     SctpServerChannelConfig setAutoRead(boolean autoRead);
115 
116     @Override
117     SctpServerChannelConfig setAutoClose(boolean autoClose);
118 
119     @Override
120     SctpServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
121 
122     @Override
123     SctpServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
124 
125     @Override
126     SctpServerChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
127 
128     @Override
129     SctpServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
130 }