public void close ( ) throws InterruptedException { assert connection != null ; if ( connection != null ) { Files . close ( inputStream ) ; if ( thread . isAlive ( ) ) { synchronized ( this ) { if ( thread . isAlive ( ) ) { thread . wait ( THREAD_STOP_TIMEOUT ) ; } } } } }
Close this event stream client . This method stops receiving thread and closes internal input stream . It is not necessary if end of event stream is controlled by server side in with case this event stream client does auto - close .