UC故事2011/12/01


1. Jiarong的例子

* Chat接收

# STACK TRACE

CmdChat::OnReceiveData(const CRtString & {0x014c7e79 "h"}, const CRtString & {0x014c7ee1 "h"}, int 1) line 4
ChatComponent::OnReceiveData(const CInfoSID & {...}, const CInfoSID & {...}, DATA_Priority DATA_PRIORITY_HIGH, unsigned long 2, unsigned long 46, unsigned char * const 0x014c7581) line 321 + 30 bytes
CConfSession::OnReceiveData(const CInfoSID & {...}, const CInfoSID & {...}, DATA_Priority DATA_PRIORITY_HIGH, unsigned long 2, const CRtString & {0x014c7581 ""}) line 1337 + 49 bytes
CConference::HandleSessionData(CInfoSvrSessionApplicationData * 0x014c7b20) line 2524
CConference::OnReceiveData(CRtMessageBlock & {...}) line 862
CConfConnection::OnReceiveData(CRtMessageBlock & {...}, IConnection * 0x00eccdec) line 349 + 31 bytes
IWLCONNMGR! 008864c8()
IWLNETWORK! 00727f84()
IWLFRAMEWORK! 1001957d()
IWLFRAMEWORK! 10019444()
IWLFRAMEWORK! 1002516d()
IWLFRAMEWORK! 1002a35b()
USER32! 77d18734()
USER32! 77d18816()
USER32! 77d189cd()
USER32! 77d196c7()
IWLFRAMEWORK! 1002b49e()
IWLFRAMEWORK! 10034659()                              // Q:Why cannot see source code ? Got it: The symble table not included ih the *.DLLs .
main(int 1, char * * 0x00ec7ad8) line 18 + 37 bytes
mainCRTStartup() line 338 + 17 bytes
KERNEL32! 7c817077()

# threads:出现5个线程

thread id         Suspend        Priority        Location

1228                0                      9             

1244                0                      9                   [CConfNetworkDetector::WaitForEchoRe]

125c                0                      9                   [_threadstartex]

1274                0                      10

15c4                 0                      9                   CmdChat::OnReceiveData


Q:这些thread都干嘛的?


* roster information update

STACK TRACE

CmdChat::OnRosterUpdateIndication(unsigned long 1, CUpdateRoster * 0x00edd5dc) line 17
ChatComponent::OnRosterUpdateIndication(unsigned long 1, CUpdateRoster * 0x00edd5dc) line 297 + 27 bytes
CConfSession::OnRosterUpdate(unsigned long 1, CUpdateRoster * 0x00edd5dc) line 1274 + 33 bytes
CConference::HandleSessionRosterIndication(CInfoSvrRosterUpdateIndication * 0x00edd570) line 1543
CConference::OnReceiveData(CRtMessageBlock & {...}) line 847
CConfConnection::OnReceiveData(CRtMessageBlock & {...}, IConnection * 0x00eda5b4) line 349 + 31 bytes
CRtIMConnection::OnReceive(CRtMessageBlock & {...}, IRtTransport * 0x00edce38, CRtTransportParameter * 0x00000000) line 879 + 50 bytes
CEventOnReceive::OnEventFire() line 514 + 59 bytes
CRtEventQueueBase::ProcessOneEvent(IRtEvent * 0x00edfa60) line 229 + 12 bytes
CRtEventQueueBase::ProcessEvents(const std::list<IRtEvent *,std::allocator<IRtEvent *> > & {...}) line 217
CRtReactorBase::ProcessHandleEvent(void * 0xffffffff, long 256, int 0, int 1, int 0) line 324 + 18 bytes
CRtReactorWin32Message::Win32SocketWndProc(HWND__ * 0x001a0720, unsigned int 1058, unsigned int 4294967295, long 256) line 114
USER32! 77d18734()
USER32! 77d18816()
USER32! 77d189cd()
USER32! 77d196c7()
CRtReactorWin32Message::RunEventLoop() line 261 + 15 bytes
CRtThreadReactor::OnThreadRun() line 67 + 19 bytes
main(int 1, char * * 0x00ed7ad8) line 18 + 37 bytes
mainCRTStartup() line 338 + 17 bytes
KERNEL32! 7c817077()


2. Jiarong的例子:Main函数

问题:在执行OnThreadRun()之前,有没有信息从Server端传回来?

     A:Wireshark跟踪情况看,没有。 2011/12/12


3. Jiarong的例子:理解TimerQueue的作用

STACK TRACE(某一个线程)

KERNEL32! 7c8017f3()
CRtTimeValue::GetTimeOfDay() line 41 + 12 bytes
CRtReactorBase::ProcessTimerTick() line 451 + 9 bytes
CRtReactorWin32Message::Win32SocketWndProc(HWND__ * 0x002a17ee, unsigned int 275, unsigned int 0, long 0) line 130
USER32! 77d18734()
USER32! 77d18816()
USER32! 77d189cd()
USER32! 77d196c7()
CRtReactorWin32Message::RunEventLoop() line 261 + 15 bytes
CRtThreadReactor::OnThreadRun() line 67 + 19 bytes
CRtThread::ThreadProc(void * 0x00ed7eb8) line 151 + 13 bytes
_threadstartex(void * 0x00ed7f68) line 227 + 13 bytes
KERNEL32! 7c80b729()


查Win32SocketWndProc()

    case WM_TIMER:
    {
        CRtReactorWin32Message *pReactor = (CRtReactorWin32Message *)::GetWindowLong(hwnd, 0);
        RT_ASSERTE(pReactor);

#ifdef RT_ENABLE_CALENDAR_TIMER
        pReactor->m_CalendarTimer.TimerTick();
#else
        pReactor->ProcessTimerTick();
#endif // RT_ENABLE_CALENDAR_TIMER
        
        break;
    }


RtResult CRtReactorBase::ProcessTimerTick()
{
#ifndef RT_DISABLE_EVENT_REPORT
    CRtTimeValue tvCur = CRtTimeValue::GetTimeOfDay();
#endif // !RT_DISABLE_EVENT_REPORT

    m_Est.EnsureSingleThread();
    RT_ASSERTE_RETURN(m_pTimerQueue, RT_ERROR_NOT_INITIALIZED);
    if (m_pTimerQueue)
        m_pTimerQueue->CheckExpire();


注:执行逻辑:

Windows的timer,触发WM_TIMER

调用reactor的ProcessTimerTick()

调用reactor中的TimerQueue的CheckExpire()

遍历TimerQueue,找出所有过期的TimerHandler,执行TimerHandler.TimeOut()


3. 杂问

ISessionClientSink
{
OnEnrollConfirm
OnDetach
OnRosterUpdateIndication
OnUpdateResource
OnReceiveData
OnUserRole                                   Q:类似方法可否用OnReceiveData来实现?
OnUserPriviledge
OnQueryUserID
OnReceiveDataEx
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值