|
发表于 2012-2-1 08:59:05
|
显示全部楼层
freeeyes 发表于 2012-1-17 09:13
感谢你对这个框架的关注。我一一回答你的问题。
1.ACE_Strategy_Acceptor这个类我没有使用过,这部分这段时 ...
bool CClientReConnectManager::SendData(int nServerID, const char* pData, int nSize)
{
ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_ThreadWritrLock);
mapReactorConnectInfo::iterator f = m_mapConnectInfo.find(nServerID);
if(f == m_mapConnectInfo.end())
{
//如果这个链接已经存在,则不创建新的链接
OUR_DEBUG((LM_ERROR, "[CProConnectManager::Close]nServerID =(%d) is not exist.\n", nServerID));
SAFE_DELETE_ARRAY(pData);
return false;
}
CReactorClientInfo* pClientInfo = (CReactorClientInfo* )f->second;
ACE_Message_Block* pmblk = App_MessageBlockManager::instance()->Create(nSize);
if(NULL == pmblk)
{
OUR_DEBUG((LM_ERROR, "[CClientReConnectManager::Close]nServerID =(%d) pmblk is NULL.\n", nServerID));
SAFE_DELETE_ARRAY(pData);
return false;
}
ACE_OS::memcpy(pmblk->wr_ptr(), pData, nSize);
pmblk->wr_ptr(nSize);
//-- SAFE_DELETE_ARRAY(pData);
//发送数据
return pClientInfo->SendData(pmblk);
}
SAFE_DELETE_ARRAY(pData);执行到这里崩溃 |
|