天天看點

UC故事 2011/12/05 總結與計劃(續2)

1. 要點回顧

 * SendData/ReceiveData的本質:

SendData=Main thread向network thread發送(PostEvent)一個CRtEventSendData;在CRtEventSendData::OnEventFire中,network thread通過socket送出

ReceiveData=network thread從socket接收資料,向main thread發送(PostEvent)一個CRtEventOnReceive;main thread在CRtEventOnReceive::OnEventFire中,适當方法處理,直到CConference對象及之上

注:XXXEvent是系統處理的核心

* 發送與接收的差別

發送的時候,有若幹”政策“需要實施,如優先級(CConfConnection),UDP/TCP選擇(CConfPort)

接收的時候,無對應政策

2. 問題彙總

Q:CConference::UpdateSessionChannel究竟完成什麼功能?

Q:CConference/CConfSession等對象隻會出現在main thread的執行中,不會出現在network thread中,對嗎?

Q:CConference到底有沒有直接與Server通訊的能力?

       A:I think no. CConference存在于main thread的context中,必須通過向network thread發送PostEvent方式來向Server發送資訊。

       跟蹤分析CConference::SendData,結果如何?

       CConference -> CConfPort -> CConfConnection -> CRtIMConnection -> CRtTransportTcpT

       Q:似乎直接就把pdu發給server了,沒有通過pReactor->PostEvent()?

       Q:或者network thread中也有CConference對象?不太可能吧?

Q:所有資料(a/v/d都表現為Event)?所有資料的收發都表現為event的Post?

3. 下步計劃

4. 雜想雜問

5. Jiarong的代碼

E/// D2的代碼為何不能直接看到UI?

chat與另一用戶端似乎不通?

繼續閱讀