View Javadoc
1   /*
2    * Copyright 2013 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.socket.oio;
17  
18  import io.netty.buffer.ByteBufAllocator;
19  import io.netty.channel.ChannelConfig;
20  import io.netty.channel.ChannelOption;
21  import io.netty.channel.MessageSizeEstimator;
22  import io.netty.channel.RecvByteBufAllocator;
23  import io.netty.channel.WriteBufferWaterMark;
24  import io.netty.channel.socket.SocketChannelConfig;
25  
26  /**
27   * A {@link ChannelConfig} for a {@link OioSocketChannel}.
28   *
29   * <h3>Available options</h3>
30   *
31   * In addition to the options provided by {@link SocketChannelConfig},
32   * {@link OioSocketChannelConfig} allows the following options in the
33   * option map:
34   *
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_TIMEOUT}</td><td>{@link #setSoTimeout(int)}</td>
40   * </tr>
41   * </table>
42   */
43  public interface OioSocketChannelConfig extends SocketChannelConfig {
44  
45      /**
46       * Sets the maximal time a operation on the underlying socket may block.
47       */
48      OioSocketChannelConfig setSoTimeout(int timeout);
49  
50      /**
51       * Returns the maximal time a operation on the underlying socket may block.
52       */
53      int getSoTimeout();
54  
55      @Override
56      OioSocketChannelConfig setTcpNoDelay(boolean tcpNoDelay);
57  
58      @Override
59      OioSocketChannelConfig setSoLinger(int soLinger);
60  
61      @Override
62      OioSocketChannelConfig setSendBufferSize(int sendBufferSize);
63  
64      @Override
65      OioSocketChannelConfig setReceiveBufferSize(int receiveBufferSize);
66  
67      @Override
68      OioSocketChannelConfig setKeepAlive(boolean keepAlive);
69  
70      @Override
71      OioSocketChannelConfig setTrafficClass(int trafficClass);
72  
73      @Override
74      OioSocketChannelConfig setReuseAddress(boolean reuseAddress);
75  
76      @Override
77      OioSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth);
78  
79      @Override
80      OioSocketChannelConfig setAllowHalfClosure(boolean allowHalfClosure);
81  
82      @Override
83      OioSocketChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis);
84  
85      @Override
86      @Deprecated
87      OioSocketChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead);
88  
89      @Override
90      OioSocketChannelConfig setWriteSpinCount(int writeSpinCount);
91  
92      @Override
93      OioSocketChannelConfig setAllocator(ByteBufAllocator allocator);
94  
95      @Override
96      OioSocketChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator);
97  
98      @Override
99      OioSocketChannelConfig setAutoRead(boolean autoRead);
100 
101     @Override
102     OioSocketChannelConfig setAutoClose(boolean autoClose);
103 
104     @Override
105     OioSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
106 
107     @Override
108     OioSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
109 
110     @Override
111     OioSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
112 
113     @Override
114     OioSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
115 }