Package com.caucho.network.balance

Examples of com.caucho.network.balance.ClientSocket


    OutputStream out = res.getOutputStream();

    String sessionId = null;

    ClientSocket stream = _loadBalancer.openSticky(sessionId, null);
    boolean isValid = false;

    if (stream == null) {
      if (log.isLoggable(Level.FINE))
        log.fine(this + " cannot open a stream from " + _loadBalancer);

      res.sendError(503);
      return;
    }

    try {
      // fcgiSocket.setExpire(Alarm.getCurrentTime() + _keepaliveTimeout);

      boolean isKeepalive = true;
      long startRequestTime = Alarm.getCurrentTime();
     
      if (handleRequest(req, res, stream, out, isKeepalive)) {
        stream.free(startRequestTime);
        stream = null;
      }
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
    } finally {
      if (stream != null)
        stream.close();
    }
  }
View Full Code Here


    }

    if (queryString != null)
      uri += '?' + queryString;

    ClientSocket stream = _loadBalancer.openSticky(sessionId, null);

    try {
      long startRequestTime = Alarm.getCurrentTime();
     
      if (stream == null) {
        log.warning(L.l("{0}: no backend servers available to process {1}",
                        this, req.getRequestURI()));

        res.sendError(503); // send a busy
      }
      else if (handleRequest(req, res, uri, stream)) {
        stream.free(startRequestTime);
        stream = null;
        return;
      }
    } finally {
      if (stream != null)
        stream.close();
    }
  }
View Full Code Here

    }

    if (queryString != null)
      uri += '?' + queryString;

    ClientSocket stream = _loadBalancer.openServer(sessionId, null);

    try {
      long startRequestTime = Alarm.getCurrentTime();
     
      if (stream == null) {
        log.warning(L.l("{0}: no backend servers available to process {1}",
                        this, req.getRequestURI()));

        res.sendError(503); // send a busy
      }
      else if (handleRequest(req, res, uri, stream)) {
        stream.free(startRequestTime);
        stream = null;
        return;
      }
    } finally {
      if (stream != null)
        stream.close();
    }
  }
View Full Code Here

    OutputStream out = res.getOutputStream();

    String sessionId = null;

    ClientSocket stream = _loadBalancer.openServer(sessionId, null);
    boolean isValid = false;

    if (stream == null) {
      if (log.isLoggable(Level.FINE))
        log.fine(this + " cannot open a stream from " + _loadBalancer);

      res.sendError(503);
      return;
    }

    try {
      // fcgiSocket.setExpire(Alarm.getCurrentTime() + _keepaliveTimeout);

      boolean isKeepalive = true;
      long startRequestTime = Alarm.getCurrentTime();
     
      if (handleRequest(req, res, stream, out, isKeepalive)) {
        stream.free(startRequestTime);
        stream = null;
      }
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
    } finally {
      if (stream != null)
        stream.close();
    }
  }
View Full Code Here

TOP

Related Classes of com.caucho.network.balance.ClientSocket

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.