查看本类的 API文档回源码主页即时通讯网 - 即时通讯开发者社区!
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    *   https://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   * @deprecated use NIO / EPOLL / KQUEUE transport.
44   */
45  @Deprecated
46  public interface OioSocketChannelConfig extends SocketChannelConfig {
47  
48      /**
49       * Sets the maximal time a operation on the underlying socket may block.
50       */
51      OioSocketChannelConfig setSoTimeout(int timeout);
52  
53      /**
54       * Returns the maximal time a operation on the underlying socket may block.
55       */
56      int getSoTimeout();
57  
58      @Override
59      OioSocketChannelConfig setTcpNoDelay(boolean tcpNoDelay);
60  
61      @Override
62      OioSocketChannelConfig setSoLinger(int soLinger);
63  
64      @Override
65      OioSocketChannelConfig setSendBufferSize(int sendBufferSize);
66  
67      @Override
68      OioSocketChannelConfig setReceiveBufferSize(int receiveBufferSize);
69  
70      @Override
71      OioSocketChannelConfig setKeepAlive(boolean keepAlive);
72  
73      @Override
74      OioSocketChannelConfig setTrafficClass(int trafficClass);
75  
76      @Override
77      OioSocketChannelConfig setReuseAddress(boolean reuseAddress);
78  
79      @Override
80      OioSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth);
81  
82      @Override
83      OioSocketChannelConfig setAllowHalfClosure(boolean allowHalfClosure);
84  
85      @Override
86      OioSocketChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis);
87  
88      @Override
89      @Deprecated
90      OioSocketChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead);
91  
92      @Override
93      OioSocketChannelConfig setWriteSpinCount(int writeSpinCount);
94  
95      @Override
96      OioSocketChannelConfig setAllocator(ByteBufAllocator allocator);
97  
98      @Override
99      OioSocketChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator);
100 
101     @Override
102     OioSocketChannelConfig setAutoRead(boolean autoRead);
103 
104     @Override
105     OioSocketChannelConfig setAutoClose(boolean autoClose);
106 
107     @Override
108     OioSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
109 
110     @Override
111     OioSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
112 
113     @Override
114     OioSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
115 
116     @Override
117     OioSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
118 }