private void sendError(String status,String msg){
  try {
    if (status == null)     throw new Error("sendResponse(): Status can't be null.");
    final OutputStream out=mySocket.getOutputStream();
    PrintWriter pw=new PrintWriter(out);
    pw.print("HTTP/1.0 " + status + " \r\n");
    pw.print("Content-Type: text/plain\r\n");
    pw.print("Date: " + gmtFrmt.format(new Date()) + "\r\n");
    pw.print("\r\n");
    pw.flush();
    out.flush();
    out.close();
    mySocket.close();
  }
 catch (  IOException ioe) {
    try {
      mySocket.close();
    }
 catch (    Throwable t) {
    }
  }
}

private void sendError ( String status , String msg ) { try { if ( status == null ) throw new Error ( "sendResponse(): Status can't be null." ) ; final OutputStream out = mySocket . getOutputStream ( ) ; PrintWriter pw = new PrintWriter ( out ) ; pw . print ( "HTTP/1.0 " + status + " \r\n" ) ; pw . print ( "Content-Type: text/plain\r\n" ) ; pw . print ( "Date: " + gmtFrmt . format ( new Date ( ) ) + "\r\n" ) ; pw . print ( "\r\n" ) ; pw . flush ( ) ; out . flush ( ) ; out . close ( ) ; mySocket . close ( ) ; } catch ( IOException ioe ) { try { mySocket . close ( ) ; } catch ( Throwable t ) { } } }
returns an error message as a http response and
