@ Override public void waitForFinish ( ) throws IOException { if ( future == null ) { throw new IllegalStateException ( "not started" ) ; } try { future . get ( ) ; } catch ( InterruptedException | ExecutionException ex ) { throw new IOException ( ex ) ; } }
Wait until other peer has closed connection or virtual circuit is closed by interrupt .