public override void Activate()
{
#if POB_DEBUG
Console.Error.WriteLine("In Activate: {0}", _node.Address);
#endif
if( IsActive == false ) {
return;
}
DateTime now = DateTime.UtcNow;
lock( _sync ) {
if( now - _last_retry_time < _current_retry_interval ) {
return;
}
_last_retry_time = now;
//Double the length of time we wait (resets to default on connections)
_current_retry_interval += _current_retry_interval;
_current_retry_interval = (_MAX_RETRY_INTERVAL < _current_retry_interval) ?
_MAX_RETRY_INTERVAL : _current_retry_interval;
}
if( !_node.IsConnected ) {
return;
}
if( NeedShortcut ) {
/*
* If we are trying to get near connections it
* is not smart to try to get a shortcut. We
* need to make sure we are on the proper place in
* the ring before doing the below:
*/
#if POB_DEBUG
Console.Error.WriteLine("NeedShortcut: {0}", _node.Address);
#endif
CreateShortcut();
} else if (NeedBypass) {
CreateBypass();
}
}