public void cutLink ( int hostIdA , int hostIdB ) { if ( m_localHostId == hostIdA ) { Iterator < ForeignHost > it = m_foreignHosts . get ( hostIdB ) . iterator ( ) ; while ( it . hasNext ( ) ) { ForeignHost fh = it . next ( ) ; fh . cutLink ( ) ; } } if ( m_localHostId == hostIdB ) { Iterator < ForeignHost > it = m_foreignHosts . get ( hostIdA ) . iterator ( ) ; while ( it . hasNext ( ) ) { ForeignHost fh = it . next ( ) ; fh . cutLink ( ) ; } } }
Cut the network connection between two hostids immediately Useful for simulating network partitions