public void sendResponse ( int code , String response ) { if ( con . isClosed ( ) ) return ; if ( response == null || response . isEmpty ( ) ) { response = "Unknown" ; } try { if ( response . charAt ( 0 ) == ' ' ) { writer . write ( code + response + "\r\n" ) ; } else { writer . write ( code + " " + response + "\r\n" ) ; } writer . flush ( ) ; } catch ( IOException ex ) { Utils . closeQuietly ( this ) ; } responseSent = true ; }
Sends a response to the connection