private void cleanupWriterSocket ( PrintWriter pwriter ) { try { if ( pwriter != null ) { pwriter . flush ( ) ; pwriter . close ( ) ; } } catch ( Exception e ) { LOG . info ( "Error closing PrintWriter " , e ) ; } finally { try { close ( ) ; } catch ( Exception e ) { LOG . error ( "Error closing a command socket " , e ) ; } } }
clean up the socket related to a command and also make sure we flush the data before we do that