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;
21
22 import java.net.Socket;
23
24 import org.apache.mina.core.session.IoSessionConfig;
25
26 /**
27 * An {@link IoSessionConfig} for socket transport type.
28 *
29 * @author <a href="http://mina.apache.org">Apache MINA Project</a>
30 */
31 public interface SocketSessionConfig extends IoSessionConfig {
32 /**
33 * @see Socket#getReuseAddress()
34 */
35 boolean isReuseAddress();
36
37 /**
38 * @see Socket#setReuseAddress(boolean)
39 */
40 void setReuseAddress(boolean reuseAddress);
41
42 /**
43 * @see Socket#getReceiveBufferSize()
44 */
45 int getReceiveBufferSize();
46
47 /**
48 * @see Socket#setReceiveBufferSize(int)
49 */
50 void setReceiveBufferSize(int receiveBufferSize);
51
52 /**
53 * @see Socket#getSendBufferSize()
54 */
55 int getSendBufferSize();
56
57 /**
58 * @see Socket#setSendBufferSize(int)
59 */
60 void setSendBufferSize(int sendBufferSize);
61
62 /**
63 * @see Socket#getTrafficClass()
64 */
65 int getTrafficClass();
66
67 /**
68 * @see Socket#setTrafficClass(int)
69 */
70 void setTrafficClass(int trafficClass);
71
72 /**
73 * @see Socket#getKeepAlive()
74 */
75 boolean isKeepAlive();
76
77 /**
78 * @see Socket#setKeepAlive(boolean)
79 */
80 void setKeepAlive(boolean keepAlive);
81
82 /**
83 * @see Socket#getOOBInline()
84 */
85 boolean isOobInline();
86
87 /**
88 * @see Socket#setOOBInline(boolean)
89 */
90 void setOobInline(boolean oobInline);
91
92 /**
93 * Please note that enabling <tt>SO_LINGER</tt> in Java NIO can result
94 * in platform-dependent behavior and unexpected blocking of I/O thread.
95 *
96 * @see Socket#getSoLinger()
97 * @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6179351">Sun Bug Database</a>
98 */
99 int getSoLinger();
100
101 /**
102 * Please note that enabling <tt>SO_LINGER</tt> in Java NIO can result
103 * in platform-dependent behavior and unexpected blocking of I/O thread.
104 *
105 * @param soLinger Please specify a negative value to disable <tt>SO_LINGER</tt>.
106 *
107 * @see Socket#setSoLinger(boolean, int)
108 * @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6179351">Sun Bug Database</a>
109 */
110 void setSoLinger(int soLinger);
111
112 /**
113 * @see Socket#getTcpNoDelay()
114 */
115 boolean isTcpNoDelay();
116
117 /**
118 * @see Socket#setTcpNoDelay(boolean)
119 */
120 void setTcpNoDelay(boolean tcpNoDelay);
121 }