1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 *
19 */
20 package org.apache.mina.transport.socket.nio;
21
22 import java.net.Socket;
23
24 import org.apache.mina.common.IoSessionConfig;
25
26 /**
27 * An {@link IoSessionConfig} for socket transport type.
28 *
29 * @author The Apache Directory Project (mina-dev@directory.apache.org)
30 * @version $Rev: 555855 $, $Date: 2007-07-13 12:19:00 +0900 (Fri, 13 Jul 2007) $
31 */
32 public interface SocketSessionConfig extends IoSessionConfig {
33 /**
34 * @see Socket#getReuseAddress()
35 */
36 boolean isReuseAddress();
37
38 /**
39 * @see Socket#setReuseAddress(boolean)
40 */
41 void setReuseAddress(boolean reuseAddress);
42
43 /**
44 * @see Socket#getReceiveBufferSize()
45 */
46 int getReceiveBufferSize();
47
48 /**
49 * @see Socket#setReceiveBufferSize(int)
50 */
51 void setReceiveBufferSize(int receiveBufferSize);
52
53 /**
54 * @see Socket#getSendBufferSize()
55 */
56 int getSendBufferSize();
57
58 /**
59 * @see Socket#setSendBufferSize(int)
60 */
61 void setSendBufferSize(int sendBufferSize);
62
63 /**
64 * @see Socket#getTrafficClass()
65 */
66 int getTrafficClass();
67
68 /**
69 * @see Socket#setTrafficClass(int)
70 */
71 void setTrafficClass(int trafficClass);
72
73 /**
74 * @see Socket#getKeepAlive()
75 */
76 boolean isKeepAlive();
77
78 /**
79 * @see Socket#setKeepAlive(boolean)
80 */
81 void setKeepAlive(boolean keepAlive);
82
83 /**
84 * @see Socket#getOOBInline()
85 */
86 boolean isOobInline();
87
88 /**
89 * @see Socket#setOOBInline(boolean)
90 */
91 void setOobInline(boolean oobInline);
92
93 /**
94 * Please note that enabling <tt>SO_LINGER</tt> in Java NIO can result
95 * in platform-dependent behavior and unexpected blocking of I/O thread.
96 *
97 * @see Socket#getSoLinger()
98 * @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6179351">Sun Bug Database</a>
99 */
100 int getSoLinger();
101
102 /**
103 * Please note that enabling <tt>SO_LINGER</tt> in Java NIO can result
104 * in platform-dependent behavior and unexpected blocking of I/O thread.
105 *
106 * @param soLinger Please specify a negative value to disable <tt>SO_LINGER</tt>.
107 *
108 * @see Socket#setSoLinger(boolean, int)
109 * @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6179351">Sun Bug Database</a>
110 */
111 void setSoLinger(int soLinger);
112
113 /**
114 * @see Socket#getTcpNoDelay()
115 */
116 boolean isTcpNoDelay();
117
118 /**
119 * @see Socket#setTcpNoDelay(boolean)
120 */
121 void setTcpNoDelay(boolean tcpNoDelay);
122 }