You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by jv...@apache.org on 2011/09/27 13:58:15 UTC
svn commit: r1176344 - in /mina/trunk/core/src/main/java/org/apache/mina:
api/IoSessionConfig.java transport/tcp/SocketSessionConfig.java
Author: jvermillard
Date: Tue Sep 27 11:58:14 2011
New Revision: 1176344
URL: http://svn.apache.org/viewvc?rev=1176344&view=rev
Log:
DIRMINA-863 session configuration interfaces, WIP
Added:
mina/trunk/core/src/main/java/org/apache/mina/transport/tcp/SocketSessionConfig.java (with props)
Modified:
mina/trunk/core/src/main/java/org/apache/mina/api/IoSessionConfig.java
Modified: mina/trunk/core/src/main/java/org/apache/mina/api/IoSessionConfig.java
URL: http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/api/IoSessionConfig.java?rev=1176344&r1=1176343&r2=1176344&view=diff
==============================================================================
--- mina/trunk/core/src/main/java/org/apache/mina/api/IoSessionConfig.java (original)
+++ mina/trunk/core/src/main/java/org/apache/mina/api/IoSessionConfig.java Tue Sep 27 11:58:14 2011
@@ -19,6 +19,8 @@
*/
package org.apache.mina.api;
+import org.apache.mina.service.SelectorProcessor;
+
/**
* The configuration of {@link IoSession}.
*
@@ -41,4 +43,17 @@ public interface IoSessionConfig {
* @param ildeTimeInMilli the timeout in milliseconds
*/
void setIdleTimeInMillis(IdleStatus status, long ildeTimeInMilli);
+
+ /**
+ * Returns the size of the read buffer the {@link SelectorProcessor} allocates
+ * per each read.
+ */
+ int getReadBufferSize();
+
+ /**
+ * Sets the size of the read buffer the {@link SelectorProcessor} allocates
+ * per each read.
+ */
+ void setReadBufferSize(int readBufferSize);
+
}
Added: mina/trunk/core/src/main/java/org/apache/mina/transport/tcp/SocketSessionConfig.java
URL: http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/transport/tcp/SocketSessionConfig.java?rev=1176344&view=auto
==============================================================================
--- mina/trunk/core/src/main/java/org/apache/mina/transport/tcp/SocketSessionConfig.java (added)
+++ mina/trunk/core/src/main/java/org/apache/mina/transport/tcp/SocketSessionConfig.java Tue Sep 27 11:58:14 2011
@@ -0,0 +1,122 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.mina.transport.tcp;
+
+import java.net.Socket;
+
+import org.apache.mina.api.IoSessionConfig;
+
+/**
+ * A {@link IoSessionConfig} for socket based transports.
+ *
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ */
+public interface SocketSessionConfig extends IoSessionConfig {
+
+ /**
+ * @see Socket#getTcpNoDelay()
+ */
+ boolean isTcpNoDelay();
+
+ /**
+ * @see Socket#setTcpNoDelay(boolean)
+ */
+ void setTcpNoDelay(boolean tcpNoDelay);
+
+ /**
+ * @see Socket#getReuseAddress()
+ */
+ boolean isReuseAddress();
+
+ /**
+ * @see Socket#setReuseAddress(boolean)
+ */
+ void setReuseAddress(boolean reuseAddress);
+
+ /**
+ * @see Socket#getReceiveBufferSize()
+ */
+ int getReceiveBufferSize();
+
+ /**
+ * @see Socket#setReceiveBufferSize(int)
+ */
+ void setReceiveBufferSize(int receiveBufferSize);
+
+ /**
+ * @see Socket#getSendBufferSize()
+ */
+ int getSendBufferSize();
+
+ /**
+ * @see Socket#setSendBufferSize(int)
+ */
+ void setSendBufferSize(int sendBufferSize);
+
+ /**
+ * @see Socket#getTrafficClass()
+ */
+ int getTrafficClass();
+
+ /**
+ * @see Socket#setTrafficClass(int)
+ */
+ void setTrafficClass(int trafficClass);
+
+ /**
+ * @see Socket#getKeepAlive()
+ */
+ boolean isKeepAlive();
+
+ /**
+ * @see Socket#setKeepAlive(boolean)
+ */
+ void setKeepAlive(boolean keepAlive);
+
+ /**
+ * @see Socket#getOOBInline()
+ */
+ boolean isOobInline();
+
+ /**
+ * @see Socket#setOOBInline(boolean)
+ */
+ void setOobInline(boolean oobInline);
+
+ /**
+ * Please note that enabling <tt>SO_LINGER</tt> in Java NIO can result
+ * in platform-dependent behavior and unexpected blocking of I/O thread.
+ *
+ * @see Socket#getSoLinger()
+ * @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6179351">Sun Bug Database</a>
+ */
+ int getSoLinger();
+
+ /**
+ * Please note that enabling <tt>SO_LINGER</tt> in Java NIO can result
+ * in platform-dependent behavior and unexpected blocking of I/O thread.
+ *
+ * @param soLinger Please specify a negative value to disable <tt>SO_LINGER</tt>.
+ *
+ * @see Socket#setSoLinger(boolean, int)
+ * @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6179351">Sun Bug Database</a>
+ */
+ void setSoLinger(int soLinger);
+
+}
Propchange: mina/trunk/core/src/main/java/org/apache/mina/transport/tcp/SocketSessionConfig.java
------------------------------------------------------------------------------
svn:mime-type = text/plain