亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? atlsrecordstage.java

?? ATLS原代碼庫,實現(xiàn)的很不錯 ATLS原代碼庫,實現(xiàn)的很不錯
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (c) 2002 by The Regents of the University of California.  * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice and the following * two paragraphs appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * Author: Dennis Chi <denchi@uclink4.berkeley.edu>  * */package seda.sandStorm.lib.aTLS;import seda.sandStorm.lib.aTLS.protocol.*;import seda.sandStorm.api.*;import seda.sandStorm.lib.aSocket.*;import seda.sandStorm.core.*;import seda.sandStorm.main.*;import COM.claymoresystems.ptls.*;import java.util.*;import java.io.*;import java.net.*;import java.lang.*;/** * aTLSRecordStage is the stage in which all data is received. Each packet will be parsed * by aTLSPacketReader and appropriately dealt with based on the type of message it is. * If it is a handshake packet, then will be posted to the handshake stage. If it is an * application data packet, then will be posted to the user's SinkIF. * This stage is multithreaded, but can change to single threaded by swapping * the class definitions below. *///class aTLSRecordStage implements EventHandlerIF, aTLSConst, SingleThreadedEventHandlerIF{class aTLSRecordStage implements EventHandlerIF, aTLSConst {    private static final boolean DEBUG = true;    private static final boolean DEBUG2 = false;    private ManagerIF mgr;    private SinkIF mySink, handshakeSink, encryptSink;    // this is added to profile to see how long things take in this stage:    private static final boolean PROFILE = false;    /**     * Make sure that this Hashtable is locked when being modified because     * multiple threads could be adding/retrieving/removing from the hashTable.     * This hash table will map ATcpConnections to aTLSConnections.     */    Hashtable connTable;    /**     * This hash table will map ATcpClientSockets to aTLSClientSockets so that     * any ATcpConnections that arrive will be associated with the appropriate user     * sink.     */    Hashtable clientSocketTable;    /**     * This hash table will map ATcpServerSockets to aTLSServerSockets so that     * any ATcpConnections that arrive will be associated with the appropriate user     * sink.     */    Hashtable serverSocketTable;    /**     * Creates the aTLSRecordStage. Needs the SinkIF of both the handshake stage and the     * encrypt stage because packets will be routed to those stages from here.     */    public aTLSRecordStage(ManagerIF mgr, SinkIF handshakeSink, SinkIF encryptSink) throws Exception {	this.mgr = mgr;	this.handshakeSink = handshakeSink;	this.encryptSink = encryptSink;	connTable = new Hashtable();	clientSocketTable = new Hashtable();	serverSocketTable = new Hashtable();	mgr.createStage("aTLSRecordStage", this, null);    }    /**      * The Sandstorm stage initialization method.     */    public void init(ConfigDataIF config) {	mySink = config.getStage().getSink();    }    /**     * This method handles the following different QueueElementIF types:     * aTLSConnectRequest - posted by the aTLSClientSocket. Will create an ATcpClientSocket that will try to      * connect to the associated host/port.     *     * aTLSListenRequest - posted by the aTLSServerSocket. Will create an ATcpServerSocket that will wait     * for incoming client connections.     *     * ATcpConnection - indicates that a connection should begin. Creates an aTLSConnection, and posts a     * handshakePacket to the handshakeStage to start the handshake process.     *     * SinkClosedEvent - will clean up the hash tables, etc...     *     * ATcpInPacket - will call aTLSPacketReader of the connection to parse the packet and appropriately     * deal with the data based on what type of message it is.     */    public void handleEvent(QueueElementIF element) {	if (DEBUG) System.err.println("aTLSRecordStage GOT QEL: "+element);	if (element instanceof aTLSConnectRequest) {	    // this request had to have been sent from the aTLSClientSocket class	    aTLSConnectRequest req = (aTLSConnectRequest) element;	    aTLSClientSocket atlscs = req.atlscs;	    if (PROFILE) {		atlscs.prof.addMeasurements(System.currentTimeMillis(), "aTLSRecordStage just received connect request from clientsocket, Now going to create atcpclientsocket and wait for atcpconnection");	    }			    if (DEBUG) System.err.println ("aTLSRecordStage: creating an ATcpClientSocket.");	    	    // setting up the ATcpClientSocket so that it will try to connect to server	    ATcpClientSocket atcpcs = new ATcpClientSocket(atlscs.clientHost, atlscs.clientPort, mySink);	    	    // sets a reference to the ATcpClientSocket for the aTLSClientSocket	    atlscs.setATcpClientSocket (atcpcs); 	    clientSocketTable.put (atcpcs, atlscs);	}	else if (element instanceof aTLSListenRequest) {	    // this request must be sent from aTLSServerSocket class	    aTLSListenRequest req = (aTLSListenRequest) element;	    aTLSServerSocket atlsss = req.atlsss;	    try {		if (DEBUG) System.err.println ("aTLSRecordStage: creating an ATcpServerSocket");		ATcpServerSocket atcpss = new ATcpServerSocket (atlsss.serverPort, mySink);				atlsss.setATcpServerSocket (atcpss);				serverSocketTable.put (atcpss, atlsss);	    }	    catch (IOException ioe) {		System.err.println ("aTLSRecordStage: Exception trying to create ATcpServerSocket: " + ioe);	    }	}	else if (element instanceof ATcpConnection) {	    // so a "connection" has been established, so create an aTLSConnection and start handshake	    ATcpConnection atcpconn = (ATcpConnection) element;	    aTLSConnection atlsconn;	    if (atcpconn.getClientSocket() != null) {		if (DEBUG) System.err.println ("aTLSRecordStage: Creating an aTLSConnection.");		aTLSClientSocket cs = (aTLSClientSocket)clientSocketTable.get(atcpconn.getClientSocket());				if (PROFILE) {		    cs.prof.addMeasurements(System.currentTimeMillis(), "aTLSRecordStage just received ATcpConnection for client, going to startReader and start the handshake");		}				atlsconn = new aTLSConnection (cs, atcpconn, cs.getSink(), encryptSink, mySink, false, cs.ctx, cs.aTLSSessionID);		// allow the client socket to have a reference to the aTLSConnection to gain		// acces to the sessionID of this connection for resuming purposes.		cs.setaTLSConn (atlsconn);				if (PROFILE) {		    atlsconn.prof = cs.prof;		}	    }	    else {		aTLSServerSocket ss = (aTLSServerSocket)serverSocketTable.get(atcpconn.getServerSocket());		atlsconn = new aTLSConnection (ss, atcpconn, ss.getSink(), encryptSink, mySink, true, ss.ctx, null);		if (PROFILE) {		    long time = System.currentTimeMillis();		    atlsconn.prof = new aTLSprofiler (time);		    atlsconn.prof.addMeasurements(time, "aTLSRecordStage: new connection for the server, alerting handshake stage");		}	    }	    	    connTable.put (atcpconn, atlsconn);	    	    // this will now get the handshake rolling, do this regardless if client/server	    handshakeSink.enqueue_lossy(new aTLSHandshakePacket (atlsconn));	    // now I'm going to start the atcp reader so that all messages on this connection pass through this class	    atcpconn.startReader(mySink);	}	else if (element instanceof SinkClosedEvent) {	    // Some connection closed; tell the user 	    SinkClosedEvent sce = (SinkClosedEvent)element;	   	    if (!(sce.sink instanceof ATcpConnection)) {		System.err.println ("aTLSRecordStage: Bad SinkClosedEvent. Internal Error, contact mdw@cs.berkeley.edu");	    }	    aTLSConnection atlsconn = (aTLSConnection)connTable.get((ATcpConnection)sce.sink);	    if (atlsconn != null) {		// profile stuff		if (PROFILE) 		    System.err.println ("aTLSRecordStage received the sinkclosedevent, sending closedevent back to user");		// if we can, pass it to the dataSink, but if startReader hasn't been called, 		// then pass it to the newconnsink because only other place to alert the user.		if (atlsconn.getDataSink() != null) {		    atlsconn.getDataSink().enqueue_lossy(new SinkClosedEvent(atlsconn));		}		else {		    atlsconn.getNewConnSink().enqueue_lossy(new SinkClosedEvent(atlsconn));		}		cleanupConnection(atlsconn);	    }	}	else if (element instanceof ATcpInPacket) {	    // need to add the packet to the aTLSPacketReader so that it can make sure a whole	    // record has been received, and so it can order the packets based on the sequeunce number.	    // This ordering and synchronizing is necessary for multithreading because for a ssl/tls connection	    // order is the most important thing.	    ATcpInPacket pkt = (ATcpInPacket) element;	    ATcpConnection atcpconn = pkt.getConnection();	    aTLSConnection atlsconn = (aTLSConnection) connTable.get(atcpconn);	    aTLSPacketReader reader;	    synchronized (atlsconn) {		if (PROFILE) {		    atlsconn.prof.addMeasurements(System.currentTimeMillis(), "aTLSRecordStage just received an ATcpInPacket for " + atlsconn.type);		}		reader = atlsconn.getReader();		(reader.asis).addPacket(pkt);				if (DEBUG) System.err.println ("aTLSRecordStage: Calling recordReader()");		LinkedList records = null;		try {		    records = reader.readPacket();		}		catch (Exception e) {		    System.err.println ("aTLSRecordStage: Exception trying to read packet: " + e);		    e.printStackTrace();		    for (int i = 0; i < 5; i++) {			System.err.println ();		    }		    try {			atlsconn.getConnection().close(mySink);		    }		    catch (SinkClosedException sce) {			System.err.println ("aTLSRecordStage: Exception trying to close the connection " + sce);		    }		}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产sm精品调教视频网站| 日韩欧美在线观看一区二区三区| 香蕉影视欧美成人| 亚洲男人天堂av| 亚洲影视在线播放| 亚洲福利电影网| 亚洲不卡av一区二区三区| 亚洲国产一区二区三区| 亚洲精品国产第一综合99久久| 国产精品美女久久久久av爽李琼| 国产三级久久久| 成人免费在线观看入口| 一区二区三区成人| 亚洲国产一区二区视频| 免费观看一级欧美片| 国产精品主播直播| 99精品欧美一区二区蜜桃免费 | 欧美女孩性生活视频| 欧美写真视频网站| 日韩写真欧美这视频| 精品乱码亚洲一区二区不卡| 欧美精品一区二区在线观看| 欧美国产精品一区二区| 综合亚洲深深色噜噜狠狠网站| 一区二区三区精品在线观看| 免费成人性网站| 日本成人在线看| 成人动漫一区二区三区| 欧美日产在线观看| 国产欧美日韩卡一| 亚洲宅男天堂在线观看无病毒| 看片网站欧美日韩| gogo大胆日本视频一区| 7777精品伊人久久久大香线蕉经典版下载 | 欧洲av一区二区嗯嗯嗯啊| 欧美一区二区黄色| 国产亚洲欧美激情| 亚洲国产成人tv| 国产69精品久久久久毛片| 欧美日本乱大交xxxxx| 中文字幕不卡在线| 日韩av中文字幕一区二区三区| 成人av一区二区三区| 日韩精品最新网址| 亚洲在线观看免费视频| 成人永久免费视频| 日韩视频免费观看高清在线视频| 亚洲欧洲日本在线| 国产一区二三区好的| 色综合久久久久网| xnxx国产精品| 麻豆精品一区二区| 欧美性感一区二区三区| 亚洲色图丝袜美腿| 成人网页在线观看| 欧美va日韩va| 免费观看91视频大全| 欧美中文字幕一区| 亚洲欧洲另类国产综合| 国产不卡一区视频| 久久精品视频一区| 精品中文av资源站在线观看| 91搞黄在线观看| 久久久国产精华| 久久99精品国产麻豆婷婷洗澡| 欧美日韩视频在线一区二区| 亚洲激情六月丁香| 99久久久国产精品免费蜜臀| 国产精品女主播在线观看| 国产成人在线视频免费播放| 日韩欧美中文字幕制服| 日本视频一区二区三区| 日韩手机在线导航| 日韩主播视频在线| 911国产精品| 麻豆精品国产91久久久久久| 欧美成人a∨高清免费观看| 日韩不卡免费视频| 精品福利在线导航| 日本成人在线看| 日韩免费高清电影| 精品一区二区影视| 欧美成人女星排行榜| 麻豆国产精品视频| 久久久天堂av| 99精品视频中文字幕| 亚洲精品亚洲人成人网在线播放| 色呦呦日韩精品| 三级久久三级久久久| 91精品国产一区二区| 狠狠色狠狠色合久久伊人| 久久综合资源网| 成人理论电影网| 亚洲欧洲国产日韩| 欧美蜜桃一区二区三区| 美女一区二区三区在线观看| 国产日韩精品一区二区三区在线| 99久久免费精品高清特色大片| 亚洲在线免费播放| 日韩精品中文字幕一区| 成人国产精品免费| 亚洲mv在线观看| 欧美精品一区视频| 色综合视频一区二区三区高清| 亚洲一区二区中文在线| 日韩精品一区在线| 成人av电影在线观看| 国产成人在线免费| 国产精品国产三级国产普通话蜜臀 | 日韩精品影音先锋| 99re热这里只有精品免费视频| 午夜精品一区二区三区三上悠亚| 精品国产乱码久久久久久图片| 成人综合在线网站| 五月激情综合婷婷| 欧美麻豆精品久久久久久| 激情六月婷婷久久| 亚洲精品第一国产综合野| 日韩欧美国产高清| 99免费精品在线观看| 日韩欧美你懂的| 99久久婷婷国产综合精品电影| 亚洲成人动漫一区| 亚洲视频中文字幕| 精品国内二区三区| 欧美日韩一区不卡| 99久久国产综合精品女不卡| 秋霞电影网一区二区| 国产婷婷色一区二区三区四区| 成人免费视频视频| 狠狠网亚洲精品| 亚洲国产美国国产综合一区二区| 成人激情校园春色| 亚洲国产一二三| 91亚洲国产成人精品一区二区三| 精品三级av在线| 欧美性生活久久| 一区二区视频在线看| 91精品国产91热久久久做人人| 91蜜桃在线观看| 国产成人啪午夜精品网站男同| 青草国产精品久久久久久| 丝袜美腿亚洲一区二区图片| 亚洲一级电影视频| 亚洲摸摸操操av| 亚洲精品国产品国语在线app| 亚洲日本在线看| 国产精品乱码久久久久久 | 国内精品伊人久久久久av影院| 一区二区三区不卡视频在线观看| 亚洲欧洲av在线| 亚洲视频一区二区免费在线观看 | 欧美日韩不卡一区| 欧美性猛交xxxxxxxx| 欧美色图激情小说| 538在线一区二区精品国产| 69av一区二区三区| 日韩精品一区二区三区三区免费 | 欧美电视剧在线观看完整版| 欧美日韩综合色| 欧美精品丝袜中出| 在线成人免费观看| 欧美大片国产精品| 国产欧美日韩在线观看| 国产精品夫妻自拍| 亚洲主播在线播放| 秋霞电影网一区二区| 国产毛片一区二区| 丁香亚洲综合激情啪啪综合| 色狠狠av一区二区三区| 欧美一区2区视频在线观看| 日韩欧美成人激情| 国产欧美一区二区三区鸳鸯浴| 亚洲免费大片在线观看| 天堂蜜桃一区二区三区| 精品影视av免费| 不卡影院免费观看| 91麻豆精品91久久久久久清纯 | 国产在线视视频有精品| 精品一区二区三区在线视频| 国产成人午夜电影网| 在线精品国精品国产尤物884a| 在线精品观看国产| 日韩欧美一区二区不卡| 久久这里只有精品首页| 久久精品免视看| 中文字幕日韩av资源站| 亚洲尤物在线视频观看| 精品一区精品二区高清| 色一区在线观看| 91精品欧美综合在线观看最新 | 亚洲一二三四在线观看| 日本不卡一区二区| 国产成人自拍高清视频在线免费播放| 99久久er热在这里只有精品15 | 一二三区精品福利视频| 国内精品第一页| 5566中文字幕一区二区电影| 国产精品乱码一区二三区小蝌蚪| 蜜桃av一区二区三区电影|