1. 开发环境恢复
* 处理Info/controller启动问题:Bind
$20111126 17:24:29.062 16496/16684 ERROR: CRtAcceptorTcp::StartListen, bind() failed! addr=192.168.1.101 port=1224 err=10048:通常每个套接字地址(协议/网络地址/端口)只允许使用一次。
this=0x16c9540
修改controller及infoserver使用的各种ports,OK
Q:1224为什么不能用?(TCPView中看不出来任何异常)
* Client显示重连
估计是改了port number后没有重启动Servers
* Client Crash
注:没找到原因,但连续重启动client几次就好了。
Q:为什么有些模块是dll,另外一些是lib?
2. 分析client启动日志
Q:SingleServer这个选项似乎没有用?
加载一大堆DLL
加载rtConfClient.dll
如果__RT_DIAGNOSE__定义
Debug Start(究竟做了什么?)
启动客户端LaunchConf
Debug Stop
注:ConfMain Prepossesor Definition:WIN32,_DEBUG,_WINDOWS,_MBCS,__RT_DIAGNOSE__
3. 分析client启动日志(去除__RT_DIAGNOSE__定义)
* WinMain
#ifdef __RT_DIAGNOSE__
// Start debug module
pRunProc2();
RT_TRY
pRunProc(hInstance, lpCmdLine, nCmdShow);
RT_EXCEPT
// Stop debug module
pRunProc3();
#else
pRunProc(hInstance, lpCmdLine, nCmdShow);
#endif
Q:Debug到底做什么用?是在client运行的时候向Web服务端发送相关信息以搜集出问题的时候client的状态?
* CDebug.start()
$20111126 21:19:05.671 8656/15584 info: CRtThreadManager::Instance, new CRtThreadManager.
$20111126 21:19:05.671 8656/15584 info: CRtThreadManager::CRtThreadManager, this=0x20a78c8
$20111126 21:19:05.671 8656/15584 info: CRtThreadManager::InitMainThread, this=0x20a78c8
$20111126 21:19:05.687 8656/15584 info: CRtThread::Create, aType=0 aFlag=1 this=0x20a7b20
Loaded 'C:\WINDOWS\system32\msctfime.ime', no matching symbolic information found.
$20111126 21:19:05.734 8656/15584 info: CRtReactorWin32Message::Open, m_hwndNotify=0x1280ba6 this=0x20a7970
$20111126 21:19:05.734 8656/15584 info: CRtThread::Create, aType=1 aFlag=1 this=0x20a7df8
$20111126 21:19:05.796 8656/15236 info: CRtThread::ThreadProc, begin this=0x20a7df8
$20111126 21:19:05.796 8656/15236 info: CRtReactorWin32Message::Open, m_hwndNotify=0x310b9e this=0x20a7ca0
$20111126 21:19:05.796 8656/15236 info: CRtThreadReactor::OnThreadRun, Begin.
$20111126 21:19:05.796 8656/15236 info: CRtReactorWin32Message::RunEventLoop this=0x20a7ca0
注1:生成了ThreadManager,并两次启用CRTReactorWin32Message::Open().
(在干嘛? 注册CRtReactorWin32Message/CRtReactorWin32Asyncselect需要使用的Windows窗口处理函数 2011/12/07)
注2:到目前为止,没有网络连接出现。
* LaunchConf()
# leave confefence
Q:这里其实向serer发了pdu,但居然在tcpview中没有看到有tcp连接established,奇怪了?
# IConference::CreateInstance (此时没有connection对象生成,也没有网络连接产生)
# Join Conference: CConference::JoinConference ( send request to server )
Q:仍然在tcpview中见不到网络连接?
#
4. conference create
RtResult CConfProvider::CreateConference(
const ConfID_Type& confID,
const CRtUserID& userID,
const IConferenceSink* aSink,
IConference*& outConference)
{
RT_INFO_TRACE("CConfProvider::CreateConference, confID="<<confID
<<",userID="<<userID.dwUserID<<",aSink="<<aSink);
if (confID.empty() || 0 == userID.dwUserID || NULL == aSink)
{
RT_WARNING_TRACE("CConfProvider::CreateConference, invalid params!");
return RT_ERROR_INVALID_ARG;
}
bool bExist = true;
CRtAutoPtr<CConference> curconf = GetConference(confID, userID);
if (!curconf.Get())
{
bExist = false;
curconf = new CConference(confID, userID, aSink);
RT_ASSERTE_RETURN(curconf.Get(), RT_ERROR_OUT_OF_MEMORY);
m_conferences.push_back(curconf); // Q:为什么会保留很多个conferences?
}
curconf->AddReference();
outConference = (IConference*) (curconf.Get());
return bExist ? RT_ERROR_FOUND : RT_OK;
}
5. CConference::JoinConference
LOG:
$20111126 22:33:01.140 8728/10152 info: CConference::JoinConference, m_conf_status=0:
ConfInfo: ID=1000000000004,cluster=cluster1,name=,pass=1,flag=-2147483648,attendee=2000,start=1269827390,duration=3600,type=24,license=puBt0uLgSgcP8RAJaFOnKQynX+7hMMEw96GL3M/k8Kgz95fMBc80hdqXZ2QSoDc6JXH4/RNBJT9px4DImtEBKNlTOSiyLOCg0A==|Y29uZlNpdGVVc2VyPTEwMDA7Y29uZlNpdGVBdWRpdFVzZXI9MTAwO2VpbVNpdGVVc2VyPTEwMDA=,area=top,extend=,main=
UserInfo: ID=6666,name=f,role=-805306368,privilege=13631488,area=top,extend=,status=0
numberController=1,isSingleServer=0,joinFlag=2147483648 this=0x20aabd0
$20111126 22:33:01.140 8728/10152 info: CConference::ChangeRoleService, update p2p support as role change: 3489660928 this=0x20aabd0
$20111126 22:33:01.140 8728/10152 info: CRtCleanUpBase::CRtCleanUpBase, Item: 2, this: 0x20ac348
$20111126 22:33:01.140 8728/10152 info: CFileManager::CFileManager
$20111126 22:33:01.140 8728/10152 info: CRtCleanUpBase::CRtCleanUpBase, Item: 3, this: 0x20ac478
$20111126 22:33:01.140 8728/10152 info: CSDService::CSDService
$20111126 22:33:01.140 8728/10152 info: CFileManager::Initialize, dataDir=, isServer=0, clearDays=0
$20111126 22:33:01.140 8728/10152 info: CFileManager::SetDataDir, data dir=D:\confcache\8728\
$20111126 22:33:01.140 8728/10152 info: CFileManager::ClearDiskCache, data dir=D:\confcache\
$20111126 22:33:01.140 8728/10152 info: CFileManager::DirExists. Dir:D:\confcache\8728 is not exist.
$20111126 22:33:01.140 8728/10152 info: CFileManager::DirExists. Dir:D:\confcache\8728 is not exist.
$20111126 22:33:01.140 8728/10152 info: CFileManager::DirExists. Dir:D:\confcache is exist.
$20111126 22:33:01.140 8728/10152 info: CFileManager::CreateDir. mkdir:D:\confcache\8728
$20111126 22:33:01.140 8728/10152 info: CRtThread::Create, aType=1001 aFlag=2 this=0x20ac7c8
$20111126 22:33:01.593 8728/18376 info: CRtThread::ThreadProc, begin this=0x20ac7c8
$20111126 22:33:01.593 8728/18376 info: CRtThreadTaskWithEventQueueOnly::OnThreadRun, Begin.
$20111126 22:33:01.593 8728/10152 info: CPingBase::CPingBase, clusterid=cluster1 this=0x20aca60
$20111126 22:33:01.593 8728/10152 info: CPingBase::CPingBase, controllers: size=1,tcp://192.168.1.101:443 this=0x20aca60
$20111126 22:33:01.609 8728/10152 info: CConfPing::CConfPing, conference=0x20aabd0 this=0x20aca60
$20111126 22:33:01.609 8728/10152 info: CPingBase::StartPing, m_serverlists.size=1 this=0x20aca60
$20111126 22:33:01.609 8728/10152 info: CRtCleanUpBase::CRtCleanUpBase, Item: 4, this: 0x20accc0
$20111126 22:33:01.609 8728/10152 info: CRtIMConnProvider::Initialize,
$20111126 22:33:01.609 8728/10152 info: CRtIMConnProvider::Connect, pSink=0x20aca60,address aNumber=1,aEventType=2,aSync=0
$20111126 22:33:01.609 8728/10152 info: CRtIMConnProvider::Connect_i, use reliable tcp. this=0x20accc8
$20111126 22:33:01.609 8728/10152 info: CRtIMConnector::CRtIMConnector, aSink=0x20aca60,aEventType=2,aConnector=0x20ace78 this=0x20ad228
5. 一些杂问
* 80端口谁在使用?
Controller.exe:16040 TCP 192.168.1.101:80 0.0.0.0:0 LISTENING
在iwlab.ini中找不到80端口的设置。
* ConfMain.exe的网络连接什么时候冒出来的?
ConfMain.exe:8728 TCP 192.168.1.101:4303 192.168.1.101:443 CLOSE_WAIT
* log
$20111126 22:47:27.093 17704/17232 info: CRtConnectorTcpT::Connect_i, addr=192.168.1.101 port=443 fd=0xe60 this=0x20ab210
Q:这条日志谁打印的?
$20111126 22:49:16.968 17704/17232 WARN: CRtEventQueueBase::ProcessOneEvent, report, sec=163 usec=453125 aEvent=0x20ad2f8 m_dwSize=0
$20111126 22:49:17.468 17704/17232 info: CRtConnectorTcpT::OnOutput, localip=192.168.1.101 port=4404 fd=0xe60 trpt=0x20ab530 this=0x20ab210
$20111126 22:49:17.468 17704/17232 info: CRtConnRlbTcpClient::OnConnectIndication, result=0 trpt=0x20ab534 this=0x20ab3e8
$20111126 22:49:17.468 17704/17232 info: CRtConnRlbTcpClient::OnRecvConnResp, channel=28 connType=[Reliable-TCP] ticket=1694620881
这几条信息出来后,ConfMain.exe的连接可以被tcpview.exe观察到了。
可能是有一个定时期出发的吧?
::SetTimer(m_hWnd, TIME_CONF_CONNECT, TIME_CONF_CONNECT_TIME, NULL);
在CMainFrame::OnTimer上设端点,过了N分钟,断点未执行,但突然出现以下log:
$20111126 23:15:26.562 15204/1292 info: CRtConnectorTcpT::Connect_i, addr=192.168.1.101 port=443 fd=0xe74 this=0x20ab4b8
$20111126 23:15:26.578 15204/1292 WARN: CRtEventQueueBase::ProcessOneEvent, report, sec=383 usec=312500 aEvent=0x20ad3f0 m_dwSize=0
$20111126 23:15:27.078 15204/1292 info: CRtConnectorTcpT::OnOutput, localip=192.168.1.101 port=4752 fd=0xe74 trpt=0x20ab698 this=0x20ab4b8
$20111126 23:15:27.078 15204/1292 info: CRtConnRlbTcpClient::OnConnectIndication, result=0 trpt=0x20ab69c this=0x20ab550
Q:从哪里来执行的呢?