當前位置: 首頁>>代碼示例>>Java>>正文


Java AbstractSocketSessionConfig類代碼示例

本文整理匯總了Java中org.apache.mina.transport.socket.AbstractSocketSessionConfig的典型用法代碼示例。如果您正苦於以下問題:Java AbstractSocketSessionConfig類的具體用法?Java AbstractSocketSessionConfig怎麽用?Java AbstractSocketSessionConfig使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AbstractSocketSessionConfig類屬於org.apache.mina.transport.socket包,在下文中一共展示了AbstractSocketSessionConfig類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: increaseReadBufferSize

import org.apache.mina.transport.socket.AbstractSocketSessionConfig; //導入依賴的package包/類
/**
 * Increase the ReadBuffer size (it will double)
 */
public final void increaseReadBufferSize() {
	AbstractSocketSessionConfig cfg = getConfig();
	int readBufferSize = cfg.getReadBufferSize() << 1;
	if (readBufferSize <= cfg.getMaxReadBufferSize()) {
		cfg.setReadBufferSize(readBufferSize);
	}

	deferDecreaseReadBuffer = true;
}
 
開發者ID:dwing4g,項目名稱:jane,代碼行數:13,代碼來源:AbstractIoSession.java

示例2: decreaseReadBufferSize

import org.apache.mina.transport.socket.AbstractSocketSessionConfig; //導入依賴的package包/類
/**
 * Decrease the ReadBuffer size (it will be divided by a factor 2)
 */
public final void decreaseReadBufferSize() {
	if (deferDecreaseReadBuffer) {
		deferDecreaseReadBuffer = false;
		return;
	}

	AbstractSocketSessionConfig cfg = getConfig();
	int readBufferSize = cfg.getReadBufferSize() >> 1;
	if (readBufferSize >= cfg.getMinReadBufferSize()) {
		cfg.setReadBufferSize(readBufferSize);
	}

	deferDecreaseReadBuffer = true;
}
 
開發者ID:dwing4g,項目名稱:jane,代碼行數:18,代碼來源:AbstractIoSession.java

示例3: startNetwork

import org.apache.mina.transport.socket.AbstractSocketSessionConfig; //導入依賴的package包/類
private void startNetwork( Transport transport, IoFilterChainBuilder chainBuilder ) throws Exception
{
    if ( transport.getBackLog() < 0 )
    {
        // Set the backlog to the default value when it's below 0
        transport.setBackLog( 50 );
    }

    chainBuilders.add( chainBuilder );

    try
    {
        SocketAcceptor acceptor = getSocketAcceptor( transport );

        // Now, configure the acceptor
        // Disable the disconnection of the clients on unbind
        acceptor.setCloseOnDeactivation( false );

        // No Nagle's algorithm
        acceptor.getSessionConfig().setTcpNoDelay( true );

        // Inject the chain
        acceptor.setFilterChainBuilder( chainBuilder );

        // Inject the protocol handler
        acceptor.setHandler( getHandler() );

        ( ( AbstractSocketSessionConfig ) acceptor.getSessionConfig() ).setReadBufferSize( 64 * 1024 );
        ( ( AbstractSocketSessionConfig ) acceptor.getSessionConfig() ).setSendBufferSize( 64 * 1024 );

        // Bind to the configured address
        acceptor.bind();

        // We are done !
        started = true;

        if ( LOG.isInfoEnabled() )
        {
            LOG.info( "Successful bind of an LDAP Service (" + transport.getPort() + ") is completed." );
        }
    }
    catch ( IOException e )
    {
        String msg = I18n.err( I18n.ERR_171, transport.getPort() );
        LdapConfigurationException lce = new LdapConfigurationException( msg );
        lce.setCause( e );
        LOG.error( msg, e );
        throw lce;
    }
}
 
開發者ID:TremoloSecurity,項目名稱:MyVirtualDirectory,代碼行數:51,代碼來源:LdapServer.java

示例4: getConfig

import org.apache.mina.transport.socket.AbstractSocketSessionConfig; //導入依賴的package包/類
@Override
public AbstractSocketSessionConfig getConfig() {
	return config;
}
 
開發者ID:dwing4g,項目名稱:jane,代碼行數:5,代碼來源:NioSession.java

示例5: getConfig

import org.apache.mina.transport.socket.AbstractSocketSessionConfig; //導入依賴的package包/類
/**
 * @return the configuration of this session.
 */
AbstractSocketSessionConfig getConfig();
 
開發者ID:dwing4g,項目名稱:jane,代碼行數:5,代碼來源:IoSession.java


注:本文中的org.apache.mina.transport.socket.AbstractSocketSessionConfig類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。