本文整理汇总了C++中OUR_DEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ OUR_DEBUG函数的具体用法?C++ OUR_DEBUG怎么用?C++ OUR_DEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OUR_DEBUG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OUR_DEBUG
int CBaseCommand::Do_DisConnect(IMessage* pMessage)
{
//处理连接断开事件
OUR_DEBUG((LM_ERROR, "[CBaseCommand::Do_DisConnect](%d)CLIENT_LINK_CDISCONNET OK.\n", pMessage->GetMessageBase()->m_u4ConnectID));
return 0;
}
示例2: OUR_DEBUG
void CProConnectClient::Close()
{
m_ThreadWritrLock.acquire();
if(m_nIOCount > 0)
{
m_nIOCount--;
}
m_ThreadWritrLock.release();
if(m_nIOCount == 0)
{
m_Reader.cancel();
m_Writer.cancel();
if(this->handle() != ACE_INVALID_HANDLE)
{
ACE_OS::closesocket(this->handle());
this->handle(ACE_INVALID_HANDLE);
}
App_ClientProConnectManager::instance()->CloseByClient(m_nServerID);
OUR_DEBUG((LM_DEBUG, "[CProConnectClient::Close]delete OK[0x%08x], m_ems2s=%d.\n", this, m_ems2s));
delete this;
}
}
示例3: OUR_DEBUG
int CAceProactor::open(void* args)
{
OUR_DEBUG((LM_ERROR, "CAceProactor::Open Begin nProactorID= [%d].\n", m_u4ProactorID));
if(activate(THR_NEW_LWP | THR_BOUND | THR_DETACHED, m_nThreadCount) == -1)
{
m_blRun = false;
OUR_DEBUG((LM_ERROR, "[CAceProactor::Open]activate error ProactorType = [%d] nThreadCount = [%d] Start!\n", m_nProactorType, m_nThreadCount));
return -1;
}
else
{
m_blRun = true;
OUR_DEBUG((LM_ERROR, "CAceProactor::Open Begin nProactorID= [%d] OK\n", m_u4ProactorID));
return 0;
}
}
示例4: OUR_DEBUG
int ConnectAcceptor::make_svc_handler(CConnectHandler*& sh)
{
//如果正在处理的链接超过了服务器设定的数值,则不允许链接继续链接服务器
if (App_ConnectHandlerPool::instance()->GetUsedCount() > App_MainConfig::instance()->GetMaxHandlerCount())
{
OUR_DEBUG((LM_ERROR, "[ConnectAcceptor::make_svc_handler]Connect is more MaxHandlerCount(%d > %d).\n", App_ConnectHandlerPool::instance()->GetUsedCount(), App_MainConfig::instance()->GetMaxHandlerCount()));
//不允许链接
return -1;
}
else
{
//允许链接
CConnectHandler* pConnectHandler = App_ConnectHandlerPool::instance()->Create();
if (NULL != pConnectHandler)
{
pConnectHandler->SetLocalIPInfo(m_szListenIP, m_u4Port);
pConnectHandler->reactor(this->reactor());
sh = pConnectHandler;
return 0;
}
else
{
return -1;
}
}
}
示例5: sprintf_safe
int CBaseCommand::DoMessage_HttpData(IMessage* pMessage, bool& bDeleteFlag)
{
//处理接收到的握手数据,返回握手命令
char szReturnData[MAX_BUFF_500] = {'\0'};
int nLength = ACE_OS::strlen(RETURN_HTTP_HTML);
sprintf_safe(szReturnData, MAX_BUFF_500, "HTTP /1.1 200 OK\r\nServer: PSS\r\nContent-Length: %d\r\nContent-Type: text/html\r\n\r\n%s", nLength, RETURN_HTTP_HTML);
uint16 u2PostCommandID = COMMAND_RETURN_HTTP_DATA;
//返回验证码
if(NULL != m_pServerObject->GetConnectManager())
{
//发送全部数据
m_pServerObject->GetConnectManager()->PostMessage(pMessage->GetMessageBase()->m_u4ConnectID, szReturnData,
(uint32)ACE_OS::strlen(szReturnData), SENDMESSAGE_JAMPNOMAL, u2PostCommandID, PACKET_SEND_IMMEDIATLY, PACKET_IS_SELF_RECYC);
}
else
{
OUR_DEBUG((LM_INFO, "[CBaseCommand::DoMessage_HandIn] m_pConnectManager = NULL.\n"));
}
return 0;
}
示例6: OUR_DEBUG
void CLSServerManager::ReConnect(int nServerID)
{
OUR_DEBUG((LM_INFO, "[CLSServerManager::ReConnect]nServerID=%d.\n", nServerID));
//重新发送注册
Send_LG_Login();
return;
}
示例7: CAceProactor
bool CAceProactorManager::AddNewProactor(int nProactorID, int nProactorType, int nThreadCount)
{
CAceProactor* pAceProactor = new CAceProactor();
if(NULL == pAceProactor)
{
sprintf_safe(m_szError, MAX_BUFF_500, "[CAceProactorManager::AddNewProactor]New CAceProactor is NULL.");
return false;
}
pAceProactor->SetProactorID((uint32)nProactorID);
bool blState = pAceProactor->Init(nProactorType, nThreadCount);
if(!blState)
{
sprintf_safe(m_szError, MAX_BUFF_500, "%s", pAceProactor->GetError());
SAFE_DELETE(pAceProactor);
return false;
}
mapAceProactor::iterator f = m_mapAceProactor.find(nProactorID);
if(f != m_mapAceProactor.end())
{
sprintf_safe(m_szError, MAX_BUFF_500, "[CAceProactorManager::AddNewProactor]CAceProactor is exist[%d].", nProactorID);
SAFE_DELETE(pAceProactor);
return false;
}
m_mapAceProactor.insert(mapAceProactor::value_type(nProactorID, pAceProactor));
OUR_DEBUG((LM_INFO, "[CAceProactorManager::AddNewProactor]New [%d] ProactorType = [%d] nThreadCount = [%d]. pAceProactor=[%@]\n", nProactorID, nProactorType, nThreadCount,pAceProactor));
return true;
}
示例8: OUR_DEBUG
void CMakePacket::SetMessage(CPacketParse* pPacketParse, uint32 u4ConnectID, CMessage* pMessage)
{
//填充数据包头信息
_PacketHeadInfo objPacketHeadInfo;
pPacketParse->GetPacketHeadInfo(objPacketHeadInfo);
if(NULL != pMessage->GetMessageBase())
{
//开始组装数据
pMessage->GetMessageBase()->m_u4ConnectID = u4ConnectID;
pMessage->GetMessageBase()->m_u2Cmd = pPacketParse->GetPacketCommandID();
pMessage->GetMessageBase()->m_u4MsgTime = (uint32)ACE_OS::gettimeofday().sec();
pMessage->GetMessageBase()->m_u4HeadSrcSize = pPacketParse->GetPacketHeadSrcLen();
pMessage->GetMessageBase()->m_u4BodySrcSize = pPacketParse->GetPacketBodySrcLen();
//将接受的数据缓冲放入CMessage对象
pMessage->SetPacketHeadInfo(objPacketHeadInfo);
pMessage->SetPacketHead(pPacketParse->GetMessageHead());
pMessage->SetPacketBody(pPacketParse->GetMessageBody());
}
else
{
OUR_DEBUG((LM_ERROR, "[CProConnectHandle::SetMessage] ConnectID = %d, pMessage->GetMessageBase() is NULL.\n", u4ConnectID));
}
}
示例9: guard
bool CClientProConnectManager::ConnectUDP(int nServerID, const char* pIP, int nPort, uint8 u1IPType, IClientUDPMessage* pClientUDPMessage)
{
ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_ThreadWritrLock);
mapProactorUDPClientInfo::iterator f = m_mapProactorUDPClientInfo.find(nServerID);
if(f != m_mapProactorUDPClientInfo.end())
{
//如果这个链接已经存在,则不创建新的链接
OUR_DEBUG((LM_ERROR, "[CClientProConnectManager::ConnectUDP]nServerID =(%d) is exist.\n", nServerID));
return false;
}
CProactorUDPClient* pProactorUDPClient = new CProactorUDPClient();
if(NULL == pProactorUDPClient)
{
OUR_DEBUG((LM_ERROR, "[CClientProConnectManager::ConnectUDP]nServerID =(%d) pProactorUDPClient is NULL.\n", nServerID));
return false;
}
ACE_INET_Addr AddrLocal;
int nErr = 0;
if(u1IPType == TYPE_IPV4)
{
nErr = AddrLocal.set(nPort, pIP);
}
else
{
nErr = AddrLocal.set(nPort, pIP, 1, PF_INET6);
}
if(nErr != 0)
{
OUR_DEBUG((LM_INFO, "[CClientProConnectManager::ConnectUDP](%d)UDP set_address error[%d].\n", nServerID, errno));
SAFE_DELETE(pProactorUDPClient);
return false;
}
if(0 != pProactorUDPClient->OpenAddress(AddrLocal, App_ProactorManager::instance()->GetAce_Proactor(REACTOR_UDPDEFINE), pClientUDPMessage))
{
OUR_DEBUG((LM_INFO, "[CClientProConnectManager::ConnectUDP](%d)UDP OpenAddress error.\n", nServerID));
SAFE_DELETE(pProactorUDPClient);
return false;
}
m_mapProactorUDPClientInfo[nServerID] = pProactorUDPClient;
return true;
}
示例10: __ENTER_FUNCTION
int CBaseCommand::DoMessage(IMessage* pMessage, bool& bDeleteFlag)
{
//__ENTER_FUNCTION是自动给你的函数追加try的宏,用于捕捉错误,你可以使用__THROW_FUNCTION()抛出你的错误
//比如__THROW_FUNCTION("hello"); 它会自动在Log文件夹下的assert.log记录文件名,函数名,行数,描述。
//推荐你使用这个宏,记住一定要在函数的结束使用__LEAVE_FUNCTION或者__LEAVE_FUNCTION_WITHRETURN与之配对。
//__LEAVE_FUNCTION_WITHRETURN和__LEAVE_FUNCTION不同是前者可以支持函数退出的时候返回一个变量
//比如这个函数是返回一个int
//那么末尾就是__LEAVE_FUNCTION_WITHRETURN(0); 0就是返回的int,当然,也支持别的类型变量,具体看你自己的函数。
//如果函数不返回任何变量,你可以使用__LEAVE_FUNCTION即可。
__ENTER_FUNCTION();
if(m_pServerObject == NULL)
{
OUR_DEBUG((LM_ERROR, "[CBaseCommand::DoMessage] m_pServerObject is NULL.\n"));
return -1;
}
if(pMessage == NULL)
{
OUR_DEBUG((LM_ERROR, "[CBaseCommand::DoMessage] pMessage is NULL.\n"));
return -1;
}
//处理链接建立信息
if(pMessage->GetMessageBase()->m_u2Cmd == CLIENT_LINK_CONNECT)
{
OUR_DEBUG((LM_ERROR, "[CBaseCommand::DoMessage] CLIENT_LINK_CONNECT OK.\n"));
return 0;
}
//处理链接断开信息
if(pMessage->GetMessageBase()->m_u2Cmd == CLIENT_LINK_CDISCONNET)
{
OUR_DEBUG((LM_ERROR, "[CBaseCommand::DoMessage] CLIENT_LINK_CDISCONNET OK.\n"));
return 0;
}
//处理正常信息
if(pMessage->GetMessageBase()->m_u2Cmd == COMMAND_PLUGA)
{
Do_PlugA_DATA(pMessage);
}
return 0;
__LEAVE_FUNCTION_WITHRETURN(0);
}
示例11: OUR_DEBUG
bool CBaseCommand::Do_LogData(IMessage* pMessage)
{
uint32 u4PacketLen = 0;
uint16 u2CommandID = 0;
uint32 u4Index = 0;
//OUR_DEBUG((LM_INFO, "[CBaseCommand::DoMessage] CommandID = %d", COMMAND_BASE));
IBuffPacket* pBodyPacket = m_pServerObject->GetPacketManager()->Create();
if(NULL == pBodyPacket)
{
OUR_DEBUG((LM_ERROR, "[CBaseCommand::DoMessage] pBodyPacket is NULL.\n"));
return false;
}
_PacketInfo BodyPacket;
pMessage->GetPacketBody(BodyPacket);
pBodyPacket->WriteStream(BodyPacket.m_pData, BodyPacket.m_nDataLen);
(*pBodyPacket) >> u2CommandID;
(*pBodyPacket) >> u4Index;
m_pServerObject->GetPacketManager()->Delete(pBodyPacket);
//写入日志
m_pServerObject->GetLogManager()->WriteLog(LOG_SYSTEM, "[Do_LogData]LogData nIdex=%d.", u4Index);
IBuffPacket* pResponsesPacket = m_pServerObject->GetPacketManager()->Create();
uint16 u2PostCommandID = COMMAND_AUTOTEST_RETUEN_LOGDATA;
(*pResponsesPacket) << u2PostCommandID;
(*pResponsesPacket) << (uint32)0;
if(NULL != m_pServerObject->GetConnectManager())
{
//发送全部数据
m_pServerObject->GetConnectManager()->PostMessage(pMessage->GetMessageBase()->m_u4ConnectID, pResponsesPacket, SENDMESSAGE_NOMAL, u2PostCommandID, PACKET_SEND_IMMEDIATLY, PACKET_IS_FRAMEWORK_RECYC);
}
else
{
OUR_DEBUG((LM_INFO, "[CBaseCommand::DoMessage] m_pConnectManager = NULL"));
m_pServerObject->GetPacketManager()->Delete(pResponsesPacket);
}
return true;
}
示例12: guard
void CClientReConnectManager::Close()
{
ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_ThreadWritrLock);
OUR_DEBUG((LM_ERROR, "[CClientReConnectManager::Close]Begin.\n"));
//如果有定时器,则删除定时器
CancelConnectTask();
//关闭所有已存在的链接
vector<CReactorClientInfo*> vecReactorClientInfo;
m_objClientTCPList.Get_All_Used(vecReactorClientInfo);
for(int i = 0; i < (int)vecReactorClientInfo.size(); i++)
{
CReactorClientInfo* pClientInfo = vecReactorClientInfo[i];
if(NULL != pClientInfo)
{
pClientInfo->GetConnectClient()->ClientClose();
SAFE_DELETE(pClientInfo);
}
}
m_objClientTCPList.Close();
vector<CReactorUDPClient*> vecReactorUDPClient;
m_objClientUDPList.Get_All_Used(vecReactorUDPClient);
for(int i = 0; i < (int)vecReactorUDPClient.size(); i++)
{
CReactorUDPClient* pClientInfo = vecReactorUDPClient[i];
if(NULL != pClientInfo)
{
pClientInfo->Close();
SAFE_DELETE(pClientInfo);
}
}
m_objClientUDPList.Close();
m_u4MaxPoolCount = 0;
//等待各自的连接对象自己关闭,因为不是在当前线程关闭,所以这里要等一下。
ACE_Time_Value tvSleep(0, 10000);
ACE_OS::sleep(tvSleep);
OUR_DEBUG((LM_ERROR, "[CClientReConnectManager::Close]End.\n"));
}
示例13: msg_queue
int CMessageService::Close()
{
m_blRun = false;
msg_queue()->deactivate();
msg_queue()->flush();
OUR_DEBUG((LM_INFO, "[CMessageService::close] Close().\n"));
return 0;
}
示例14: OUR_DEBUG
void CBaseCommand::Do_Ftp_Login( IMessage* pMessage )
{
VCHARS_STR strUserName;
VCHARS_STR strUserPass;
IBuffPacket* pBodyPacket = m_pServerObject->GetPacketManager()->Create();
if(NULL == pBodyPacket)
{
OUR_DEBUG((LM_ERROR, "[CBaseCommand::DoMessage] pBodyPacket is NULL.\n"));
return;
}
_PacketInfo BodyPacket;
pMessage->GetPacketBody(BodyPacket);
pBodyPacket->WriteStream(BodyPacket.m_pData, BodyPacket.m_nDataLen);
(*pBodyPacket) >> strUserName;
(*pBodyPacket) >> strUserPass;
//将接收数据转换为字符串
//这里可以添加用户自己的逻辑判定方法
IBuffPacket* pResponsesPacket = m_pServerObject->GetPacketManager()->Create();
uint16 u2PostCommandID = COMMAND_RETURN_LOGIN;
//用户密码验证
uint32 u4Ret = CheckFtpUser(strUserName.text, strUserPass.text, pMessage->GetMessageBase()->m_u4ConnectID);
//返回验证结果
(*pResponsesPacket) << (uint16)u2PostCommandID; //拼接应答命令ID
(*pResponsesPacket) << (uint32)u4Ret;
m_pServerObject->GetPacketManager()->Delete(pBodyPacket);
if(NULL != m_pServerObject->GetConnectManager())
{
//发送全部数据
m_pServerObject->GetConnectManager()->PostMessage(pMessage->GetMessageBase()->m_u4ConnectID, pResponsesPacket, SENDMESSAGE_NOMAL, u2PostCommandID, PACKET_SEND_IMMEDIATLY, PACKET_IS_FRAMEWORK_RECYC);
}
else
{
OUR_DEBUG((LM_INFO, "[CBaseCommand::DoMessage] m_pConnectManager = NULL"));
m_pServerObject->GetPacketManager()->Delete(pResponsesPacket);
}
}
示例15: DoModuleMessage
//用于模块间的调用接口
int DoModuleMessage(uint16 u2CommandID, IBuffPacket* pBuffPacket, IBuffPacket* pReturnBuffPacket)
{
OUR_DEBUG((LM_INFO, "[DoModuleMessage] u2CommandID=%d, size=%d, return=%d.\n",
u2CommandID,
pBuffPacket->GetPacketLen(),
pReturnBuffPacket->GetPacketLen()));
return 0;
}