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