本文整理汇总了C++中Session::IsAcceptSocket方法的典型用法代码示例。如果您正苦于以下问题:C++ Session::IsAcceptSocket方法的具体用法?C++ Session::IsAcceptSocket怎么用?C++ Session::IsAcceptSocket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Session
的用法示例。
在下文中一共展示了Session::IsAcceptSocket方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessActiveSessionList
void SyncHandler::ProcessActiveSessionList()
{
SESSION_LIST_ITER it;
Session *pSession;
for (it = m_pActiveSessionList->begin(); it != m_pActiveSessionList->end(); ++it)
{
pSession = *it;
if ( pSession->ShouldBeRemoved() ){
continue;
}
if ( pSession->HasDisconnectOrdered() ) {
if ( pSession->GetSendBuffer()->GetLength() == 0 ) {
pSession->Remove();
}
}
else
{
if ( pSession->IsAcceptSocket() && pSession->IsOnIdle() ) {
//pSession->OnLogString( "Idle Session." );
pSession->Remove();
continue;
}
if ( !pSession->ProcessRecvdPacket(m_dwMaxPacketSize) ) {
pSession->Remove();
}
}
}
}
示例2: KickDeadSession
void SyncHandler::KickDeadSession()
{
SESSION_LIST_ITER it, it2;
Session *pSession;
m_pActiveSessionList->Lock();
for (it = m_pActiveSessionList->begin(); it != m_pActiveSessionList->end();)
{
pSession = *it;
if ( pSession->ShouldBeRemoved() ) {
it2 = it++;
m_pActiveSessionList->remove( it2 );
m_pTemplateList->push_back( pSession );
}
else {
++it;
}
}
m_pActiveSessionList->Unlock();
while ( !m_pTemplateList->empty() ) {
Session * pSession = m_pTemplateList->pop_front();
--m_numActiveSessions;
NetworkObject * pNet = pSession->GetNetworkObject();
pSession->UnbindNetworkObject();
DelEpollEvent( pSession );
FreeSession( pSession );
pNet->OnDisconnect();
if ( pSession->IsAcceptSocket() ) {
m_fnDestroyAcceptedObject(pNet);
}
else {
m_fnDestroyConnectedObject(pNet);
}
}
}