protected void DisconnectHandler(object connectiontable, EventArgs args)
{
ConnectionEventArgs ceargs = (ConnectionEventArgs)args;
Connection c = ceargs.Connection;
lock( _sync ) {
_shortcuts--;
_last_connection_time = DateTime.UtcNow;
_need_short = -1;
_need_bypass = -1;
_current_retry_interval = _DEFAULT_RETRY_INTERVAL;
_doubts_table.Remove(c.Address);
}
if( !IsActive ) {
return;
}
if( c.MainType != ConnectionType.Structured ) {
return;
}
if( c.ConType == STRUC_SHORT ) {
if( NeedShortcut ) {
CreateShortcut();
}
} else if (c.ConType == STRUC_BYPASS) {
if (NeedBypass) {
CreateBypass();
}
}
}