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


Java SSLSession.getApplicationBufferSize方法代碼示例

本文整理匯總了Java中javax.net.ssl.SSLSession.getApplicationBufferSize方法的典型用法代碼示例。如果您正苦於以下問題:Java SSLSession.getApplicationBufferSize方法的具體用法?Java SSLSession.getApplicationBufferSize怎麽用?Java SSLSession.getApplicationBufferSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.net.ssl.SSLSession的用法示例。


在下文中一共展示了SSLSession.getApplicationBufferSize方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createBuffers

import javax.net.ssl.SSLSession; //導入方法依賴的package包/類
protected void createBuffers(SSLSession session) {
    int appBufferMax = session.getApplicationBufferSize();
    int netBufferMax = session.getPacketBufferSize();
    if (this.inData == null) {
        this.inData = ByteBuffer.allocate(appBufferMax);
        this.outCrypt = ByteBuffer.allocate(netBufferMax);
        this.inCrypt = ByteBuffer.allocate(netBufferMax);
    } else {
        if (this.inData.capacity() != appBufferMax) {
            this.inData = ByteBuffer.allocate(appBufferMax);
        }
        if (this.outCrypt.capacity() != netBufferMax) {
            this.outCrypt = ByteBuffer.allocate(netBufferMax);
        }
        if (this.inCrypt.capacity() != netBufferMax) {
            this.inCrypt = ByteBuffer.allocate(netBufferMax);
        }
    }
    this.inData.rewind();
    this.inData.flip();
    this.inCrypt.rewind();
    this.inCrypt.flip();
    this.outCrypt.rewind();
    this.outCrypt.flip();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:26,代碼來源:SSLSocketChannel2.java

示例2: createBuffers

import javax.net.ssl.SSLSession; //導入方法依賴的package包/類
protected void createBuffers() {

	        SSLSession session = sslStateMachine.sslEngine.getSession();
	        appBufferMax = session.getApplicationBufferSize();
	        netBufferMax = session.getPacketBufferSize();
	        
	        if(logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
	        	logger.logDebug("appBufferMax=" + appBufferMax + " netBufferMax=" + netBufferMax);
	        }
	    }
 
開發者ID:YunlongYang,項目名稱:LightSIP,代碼行數:11,代碼來源:NioTlsMessageChannel.java

示例3: createBuffers

import javax.net.ssl.SSLSession; //導入方法依賴的package包/類
private void createBuffers() {

	        SSLSession session = sslStateMachine.sslEngine.getSession();
	        appBufferMax = session.getApplicationBufferSize();
	        netBufferMax = session.getPacketBufferSize();
	        
	        if(logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
	        	logger.logDebug("appBufferMax=" + appBufferMax + " netBufferMax=" + netBufferMax);
	        }
	    }
 
開發者ID:YunlongYang,項目名稱:LightSIP,代碼行數:11,代碼來源:NioTlsWebSocketMessageChannel.java

示例4: main

import javax.net.ssl.SSLSession; //導入方法依賴的package包/類
public static void main (String[] args) throws Exception {
    SSLContext context = SSLContext.getDefault();

    // set the property before initialization SSLEngine.
    System.setProperty("jsse.SSLEngine.acceptLargeFragments", "true");

    SSLEngine cliEngine = context.createSSLEngine();
    cliEngine.setUseClientMode(true);

    SSLEngine srvEngine = context.createSSLEngine();
    srvEngine.setUseClientMode(false);

    SSLSession cliSession = cliEngine.getSession();
    SSLSession srvSession = srvEngine.getSession();

    // check packet buffer sizes.
    if (cliSession.getPacketBufferSize() < 33049 ||
        srvSession.getPacketBufferSize() < 33049) {
            throw new Exception("Don't accept large SSL/TLS fragments");
    }

    // check application data buffer sizes.
    if (cliSession.getApplicationBufferSize() < 32768 ||
        srvSession.getApplicationBufferSize() < 32768) {
            throw new Exception(
                    "Don't accept large SSL/TLS application data ");
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:29,代碼來源:AcceptLargeFragments.java


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