Пример #1
0
bool CListenSocket::TooManySockets(bool bIgnoreInterval)
{
	if (GetOpenSockets() > thePrefs::GetMaxConnections() 
		|| (!bIgnoreInterval && m_OpenSocketsInterval > (thePrefs::GetMaxConperFive() * GetMaxConperFiveModifier()))) {
		return true;
	} else {
		return false;
	}
}
Пример #2
0
bool CListenSocket::TooManySockets( bool bIgnoreInterval, bool bUseTcp/*=false*/, bool bUseNat/*=false*/ )
{
	if (   GetOpenSockets() > thePrefs.GetMaxConnections()
		|| (m_OpenSocketsInterval > (thePrefs.GetMaxConperFive() * GetMaxConperFiveModifier()) && !bIgnoreInterval) )
		return true;

	if( bUseTcp && m_nHalfOpen >= thePrefs.GetMaxHalfConnections() && !bIgnoreInterval )
		return true;

	if(	bUseNat && m_nHalfOpenOfL2L >= thePrefs.GetMaxL2LHalfConnections() && !bIgnoreInterval ) 
		return true;

	return false;
}