Package com.errplane.http

Examples of com.errplane.http.HTTPPostHelper


  }

  private static void sendHttpReport(List<ReportHelper> rhs) {
    try {
      int bytesWritten = 0;
      HTTPPostHelper postHelper = new HTTPPostHelper();
      String rptBody = new MergedReports(rhs).getReportBody();
      bytesWritten += rptBody.length() + 1;
      OutputStream os = postHelper.getOutputStream(errplaneUrl, bytesWritten);
      os.write(rptBody.getBytes());
      os.write('\n');
      if (!postHelper.sendPost(bytesWritten)) {
        System.out.println("Cannot send tick to server");
      }
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here


  */
  public static synchronized int flush() {
    int numRemoved = 0;
    if (!reportQueue.isEmpty() && (errplaneUrl != null)) {
      int bytesWritten = 0;
      HTTPPostHelper postHelper = new HTTPPostHelper();
      try {
        while (!reportQueue.isEmpty() && (numRemoved < 200)) {
          ReportHelper rh = reportQueue.remove();
          numRemoved++;
          String rptBody = rh.getReportBody();
          bytesWritten += rptBody.length() + 1;
          OutputStream os = postHelper.getOutputStream(errplaneUrl, bytesWritten);
          os.write(rptBody.getBytes());
          os.write('\n');
          if (!postHelper.sendPost(bytesWritten)) {
            System.out.println("Cannot send tick to server");
          }
        }
      }
      catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.errplane.http.HTTPPostHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.