View Javadoc
1   /*
2    * Copyright 2012 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.udt;
17  
18  import com.barchart.udt.OptionUDT;
19  import com.barchart.udt.TypeUDT;
20  import io.netty.buffer.ByteBufAllocator;
21  import io.netty.channel.ChannelConfig;
22  import io.netty.channel.ChannelException;
23  import io.netty.channel.ChannelOption;
24  import io.netty.channel.MessageSizeEstimator;
25  import io.netty.channel.RecvByteBufAllocator;
26  
27  /**
28   * A {@link ChannelConfig} for a {@link UdtChannel}.
29   * <p>
30   * <h3>Available options</h3>
31   * In addition to the options provided by {@link ChannelConfig},
32   * {@link UdtChannelConfig} allows the following options in the option map:
33   * <p>
34   * <table border="1" cellspacing="0" cellpadding="6">
35   * <tr>
36   * <th>Name</th>
37   * <th>Associated setter method</th>
38   * </tr><tr>
39   * <td>{@link ChannelOption#SO_REUSEADDR}</td><td>{@link #setReuseAddress(boolean)}</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 ChannelOption#SO_REUSEADDR}</td><td>{@link #setReuseAddress(boolean)}</td>
46   * </tr><tr>
47   * <td>{@link ChannelOption#SO_LINGER}</td><td>{@link #setSoLinger(int)}</td>
48   * </tr><tr>
49   * <td>{@link ChannelOption#SO_RCVBUF}</td><td>{@link #setReceiveBufferSize(int)}</td>
50   * </tr><tr>
51   * <td>{@link ChannelOption#SO_SNDBUF}</td><td>{@link #setSendBufferSize(int)}</td>
52   * </tr><tr>
53   * <td>{@link UdtChannelOption#PROTOCOL_RECEIVE_BUFFER_SIZE}</td>
54   * <td>{@link #setProtocolReceiveBufferSize(int)}</td>
55   * </tr><tr>
56   * <td>{@link UdtChannelOption#PROTOCOL_SEND_BUFFER_SIZE}</td>
57   * <td>{@link #setProtocolSendBufferSize(int)}</td>
58   * </tr><tr>
59   * <td>{@link UdtChannelOption#SYSTEM_RECEIVE_BUFFER_SIZE}</td>
60   * <td>{@link #setSystemReceiveBufferSize(int)}</td>
61   * </tr><tr>
62   * <td>{@link UdtChannelOption#SYSTEM_SEND_BUFFER_SIZE}</td>
63   * <td>{@link #setSystemSendBufferSize(int)}</td>
64  
65   * </tr>
66   * </table>
67   * <p>
68   * Note that {@link TypeUDT#DATAGRAM} message oriented channels treat
69   * {@code "receiveBufferSize"} and {@code "sendBufferSize"} as maximum message
70   * size. If received or sent message does not fit specified sizes,
71   * {@link ChannelException} will be thrown.
72   *
73   * @deprecated The UDT transport is no longer maintained and will be removed.
74   */
75  @Deprecated
76  public interface UdtChannelConfig extends ChannelConfig {
77  
78      /**
79       * Gets {@link OptionUDT#Protocol_Receive_Buffer_Size}
80       */
81      int getProtocolReceiveBufferSize();
82  
83      /**
84       * Gets {@link OptionUDT#Protocol_Send_Buffer_Size}
85       */
86      int getProtocolSendBufferSize();
87  
88      /**
89       * Gets the {@link ChannelOption#SO_RCVBUF} option.
90       */
91      int getReceiveBufferSize();
92  
93      /**
94       * Gets the {@link ChannelOption#SO_SNDBUF} option.
95       */
96      int getSendBufferSize();
97  
98      /**
99       * Gets the {@link ChannelOption#SO_LINGER} option.
100      */
101     int getSoLinger();
102 
103     /**
104      * Gets {@link OptionUDT#System_Receive_Buffer_Size}
105      */
106     int getSystemReceiveBufferSize();
107 
108     /**
109      * Gets {@link OptionUDT#System_Send_Buffer_Size}
110      */
111     int getSystemSendBufferSize();
112 
113     /**
114      * Gets the {@link ChannelOption#SO_REUSEADDR} option.
115      */
116     boolean isReuseAddress();
117 
118     @Override
119     UdtChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis);
120 
121     @Override
122     UdtChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead);
123 
124     @Override
125     UdtChannelConfig setWriteSpinCount(int writeSpinCount);
126 
127     @Override
128     UdtChannelConfig setAllocator(ByteBufAllocator allocator);
129 
130     @Override
131     UdtChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator);
132 
133     @Override
134     UdtChannelConfig setAutoRead(boolean autoRead);
135 
136     @Override
137     UdtChannelConfig setAutoClose(boolean autoClose);
138 
139     @Override
140     UdtChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
141 
142     @Override
143     UdtChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
144 
145     @Override
146     UdtChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
147 
148     /**
149      * Sets {@link OptionUDT#Protocol_Receive_Buffer_Size}
150      */
151     UdtChannelConfig setProtocolReceiveBufferSize(int size);
152 
153     /**
154      * Sets {@link OptionUDT#Protocol_Send_Buffer_Size}
155      */
156     UdtChannelConfig setProtocolSendBufferSize(int size);
157 
158     /**
159      * Sets the {@link ChannelOption#SO_RCVBUF} option.
160      */
161     UdtChannelConfig setReceiveBufferSize(int receiveBufferSize);
162 
163     /**
164      * Sets the {@link ChannelOption#SO_REUSEADDR} option.
165      */
166     UdtChannelConfig setReuseAddress(boolean reuseAddress);
167 
168     /**
169      * Sets the {@link ChannelOption#SO_SNDBUF} option.
170      */
171     UdtChannelConfig setSendBufferSize(int sendBufferSize);
172 
173     /**
174      * Sets the {@link ChannelOption#SO_LINGER} option.
175      */
176     UdtChannelConfig setSoLinger(int soLinger);
177 
178     /**
179      * Sets {@link OptionUDT#System_Receive_Buffer_Size}
180      */
181     UdtChannelConfig setSystemReceiveBufferSize(int size);
182 
183     /**
184      * Sets {@link OptionUDT#System_Send_Buffer_Size}
185      */
186     UdtChannelConfig setSystemSendBufferSize(int size);
187 }