public void CheckConnection(object o, EventArgs ea)
{
if(!_active) {
return;
}
// We are trying to get StructuredConnections or LocalConnections
if(_local_cons < MAX_LC) {
DateTime now = DateTime.UtcNow;
bool ann = false;
lock(_sync) {
if(now - _last_announce_call > TimeSpan.FromSeconds(600)) {
_last_announce_call = now;
ann = true;
}
}
if(ann) {
Announce();
}
// We can establish some local connections!
if(NeedConnection) {
Activate();
}
}
}