freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

resiprocate協(xié)議棧分析-資料下載頁

2024-11-06 06:08本頁面

【導(dǎo)讀】SIP為應(yīng)用層的協(xié)議,所以不需要改變操作系統(tǒng)便可以支持。下面是SIP的分層圖示,IETF堅持分層,不同模塊功能相對獨立,各層之間松散耦合。首先祭出這面大旗,”類是對概念的描述,面向接口編程;封裝變化的概念。不是我講的,是大師們的口水。RFC協(xié)議設(shè)計的層次。他們呢,它們又有什么基本的元素及其共性呢?Resiprocate的源碼告訴了我們?nèi)绾稳ピO(shè)計和封裝這些概念的上佳實現(xiàn)。<<EffectiveC++>>的Handle_Body論和<<C++沉思錄>>的大段描述再到<<C++Model. Design>>都有發(fā)揮和外延,感興趣可以觀之。源碼中的大量Clone函數(shù)是模仿大師BS的虛擬構(gòu)造函數(shù)一說,是原型模式的體現(xiàn);operator*等;源碼中也非常注重效率如SipCore部分中大量Hash表的建立。在整個Resiprocate大家族中事務(wù)層概念1的體現(xiàn)是TransactionUser類,而其真正的實。能看出來;HandleManager點出了DialogUsageManager的管理功能的本質(zhì),并且管理各

  

【正文】 ce port unless rport present state(Helper::getPortForReply(*sip))。 statemState = Proceeding。 statemIsReliable = stateisReliable()。 stateadd(tid)。 if (Timer::T100 == 0) { statesendToWire(statemMsgToRetransmit)。 // will get deleted when this is deleted } else { 。 } } else if (sipheader(h_RequestLine).getMethod() == CANCEL) { TransactionState* matchingInvite = (sipgetTransactionId())。 if (matchingInvite == 0) { TransactionState::sendToTU(tu, controller, Helper::makeResponse(*sip, 481))。 delete sip。 return。 } else { 。 } } else if (sipheader(h_RequestLine).getMethod() != ACK) { 。 } // Ining ACK just gets passed to the TU TransactionState::sendToTU(tu, controller, sip)。 } else // new sip msg from the TU { if (sipheader(h_RequestLine).getMethod() == INVITE) { TransactionState* state = new TransactionState(controller, ClientInvite, Calling, tid, tu)。 stateadd(statemId)。 stateprocessClientInvite(sip)。 } else if (sipheader(h_RequestLine).getMethod() == ACK) { TransactionState* state = new TransactionState(controller, Stateless, Calling, tid, tu)。 stateadd(statemId)。 。 stateprocessStateless(sip)。 } else if (sipheader(h_RequestLine).getMethod() == CANCEL) { 。 } else { TransactionState* state = new TransactionState(controller, ClientNonInvite, Trying, tid, tu)。 stateadd(tid)。 stateprocessClientNonInvite(sip)。 } } } else if (sipisResponse()) // stray response { if () { delete message。 } else { TransactionState* state = new TransactionState(controller, Stateless, Calling, Data(StatelessIdCounter++), tu)。 stateadd(statemId)。 state(Timer::TimerStateless, statemId, Timer::TS )。 stateprocessStateless(sip)。 } } else // wasn39。t a request or a response { } } else { delete message。 } } 我精減大致的流程后我們可以看到 TransactionState::Process的處理分成了幾類,如: sipisExternal() if (state)(其中又細分 switch (statemMachine)) if (sipisRequest()) else if (sipisResponse()) // stray response isExternal()是代表是否是從外面通過 Transport層接收的消息,因此是做為服務(wù)端的角色; SipMessage分成兩類,我們按照源碼的注釋來看是: sip msg from transport sip msg from the TU 當(dāng)沒有和消息對應(yīng)的 TransactionState對象時,我們還要生成新的 TransactionState對象,然后根據(jù) Sip Message的方法進行處理,以一個新的 INVITE為例: if (sipheader(h_RequestLine).getMethod() == INVITE) { TransactionState* state = new TransactionState(controller, ClientInvite, Calling, tid, tu)。 stateadd(statemId)。 stateprocessClientInvite(sip)。 } 當(dāng)我們對應(yīng)消息已經(jīng)是有 TransactionState對應(yīng)時,根據(jù)其狀態(tài)機進行處理,如: switch (statemMachine) { case ClientNonInvite: stateprocessClientNonInvite(message)。 break。 。 } 當(dāng)沒有對應(yīng)狀態(tài)機時我們還要根據(jù)其到底是 if (sipisRequest()) else if (sipisResponse())產(chǎn)生新的狀態(tài)機進行處理。 源碼中針對 CANCEL和 ACK按照 RFC的定義進行了詳細處理。 接下來,看看往 Transport和 TU層是如何發(fā)的: void TransactionState::sendToWire(TransactionMessage* msg, bool resend) { SipMessage* sip = dynamic_castSipMessage*(msg)。 // !jf! for responses, go back to source always (not RFC exactly) if (mMachine == ServerNonInvite || mMachine == ServerInvite || mMachine == ServerStale) { Tuple target(mResponseTarget)。 if (siphasForceTarget()) { target = simpleTupleForUri(sipgetForceTarget())。 = 。 } else if (sipheader(h_Vias).front().exists(p_rport) amp。amp。 sipheader(h_Vias).front().param(p_rport).hasValue()) { (sipheader(h_Vias).front().param(p_rport).port())。 } else { } if (resend) { (sip, target)。 } else { (sip, target)。 } } else if (sipgetDestination().transport) { (sip, sipgetDestination())。 // dns not used } else if (mDnsResult == 0 amp。amp。 !mIsCancel) // no dns query yet { assert(sipisRequest())。 assert(!mIsCancel)。 mDnsResult = (this)。 (mDnsResult, sip)。 } else // reuse the last dns tuple { assert(sipisRequest())。 assert(() != UNKNOWN_TRANSPORT)。 if (resend) { if () { (sip, mTarget)。 } else { } } else { (sip, mTarget)。 } } } 這期間需要進行 DNS的處理然后確定目標(biāo)地址即如 mTarget者,然后交與。 Transmit 暫且不表。 再來看看 void TransactionState::sendToTU(TransactionUser* tu, TransactionControlleramp。 controller, TransactionMessage* msg) { if (!tu) { } else { } msgsetTransactionUser(tu)。 (m
點擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1