コード例 #1
0
ファイル: Server.cpp プロジェクト: erio-nk/MyCxxProgram2011
	void Disconnect(ServerSession::Ptr pSession, DISCONNECT_REASON reason)
	{
		SessionList::iterator found = _sessions.find(pSession->GetId());
		if (found != _sessions.end())
		{
			std::cout << "disconnect " << pSession->GetId() << " reason:" << reason << std::endl;
			_disconnectHandler(pSession, reason);
			_sessions.erase(found);
		}
	}
コード例 #2
0
ファイル: SessionPool.cpp プロジェクト: Akryllax/extDB2
void SessionPool::closeAll(SessionList& sessionList)
{
	SessionList::iterator it = sessionList.begin(); 
	for (; it != sessionList.end();)
	{
		try	{ (*it)->session->session()->close(); }
		catch (...) { }
		it = sessionList.erase(it);
		if (_nSessions > 0) --_nSessions;
	}
}