public void blockClose ( ) throws InterruptedException { // If the thread is new, it will never run, since we closed the connection before we actually connected if ( writer . getInnerThread ( ) . getState ( ) != Thread . State . NEW ) { writer . getInnerThread ( ) . join ( ) ; } getInnerThread ( ) . join ( ) ; }
Blocks until both threads exit . The actual close must be triggered separately . This is just a convenience method to make sure everything shuts down if desired .