001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: *
019: */
020: package org.apache.mina.transport.socket;
021:
022: import java.net.Socket;
023:
024: import org.apache.mina.common.IoSessionConfig;
025:
026: /**
027: * An {@link IoSessionConfig} for socket transport type.
028: *
029: * @author The Apache MINA Project (dev@mina.apache.org)
030: * @version $Rev: 576455 $, $Date: 2007-09-17 08:39:24 -0600 (Mon, 17 Sep 2007) $
031: */
032: public interface SocketSessionConfig extends IoSessionConfig {
033: /**
034: * @see Socket#getReuseAddress()
035: */
036: boolean isReuseAddress();
037:
038: /**
039: * @see Socket#setReuseAddress(boolean)
040: */
041: void setReuseAddress(boolean reuseAddress);
042:
043: /**
044: * @see Socket#getReceiveBufferSize()
045: */
046: int getReceiveBufferSize();
047:
048: /**
049: * @see Socket#setReceiveBufferSize(int)
050: */
051: void setReceiveBufferSize(int receiveBufferSize);
052:
053: /**
054: * @see Socket#getSendBufferSize()
055: */
056: int getSendBufferSize();
057:
058: /**
059: * @see Socket#setSendBufferSize(int)
060: */
061: void setSendBufferSize(int sendBufferSize);
062:
063: /**
064: * @see Socket#getTrafficClass()
065: */
066: int getTrafficClass();
067:
068: /**
069: * @see Socket#setTrafficClass(int)
070: */
071: void setTrafficClass(int trafficClass);
072:
073: /**
074: * @see Socket#getKeepAlive()
075: */
076: boolean isKeepAlive();
077:
078: /**
079: * @see Socket#setKeepAlive(boolean)
080: */
081: void setKeepAlive(boolean keepAlive);
082:
083: /**
084: * @see Socket#getOOBInline()
085: */
086: boolean isOobInline();
087:
088: /**
089: * @see Socket#setOOBInline(boolean)
090: */
091: void setOobInline(boolean oobInline);
092:
093: /**
094: * Please note that enabling <tt>SO_LINGER</tt> in Java NIO can result
095: * in platform-dependent behavior and unexpected blocking of I/O thread.
096: *
097: * @see Socket#getSoLinger()
098: * @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6179351">Sun Bug Database</a>
099: */
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: }
|