protected void UpdateNeighborStatus(object contab, EventArgs args)
{
ConnectionEventArgs cea = (ConnectionEventArgs)args;
if( cea.ConnectionType != ConnectionType.Structured ) {
//We don't do anything,
return;
}
//This is the list we had when things changed
ConnectionList structs = cea.CList;
//structs is constant
if( structs.Count == 0 ) {
//There is no one to talk to
return;
}
/*
* Get the data we need about this connection:
*/
Connection con = cea.Connection;
AHAddress new_address = (AHAddress)con.Address;
/*
* Update the left neighbor:
*/
Connection lc = structs.GetLeftNeighborOf(new_address);
EnqueueAction( new UpdateNeighborAction(this, con.ConType, lc) );
/*
* Update the right neighbor:
*/
Connection rc = structs.GetRightNeighborOf(new_address);
if( lc != rc ) {
EnqueueAction( new UpdateNeighborAction(this, con.ConType, rc) );
}
}