Package pt.opensoft.net

Examples of pt.opensoft.net.CGISocket


  private void invokeSDC() {
    try {
      List listRequest = readFile(_file);
      for (Iterator iterator = listRequest.iterator(); iterator.hasNext();) {
        final InetSocketAddress address = new InetSocketAddress(_host, _port);
        final CGISocket protocol = new CGISocket(address, CONNECT_TIMEOUT);
        protocol.setTimeout(CONNECT_TIMEOUT);
        String response = "";
        try {
          Timer timer = new Timer();
          timer.start();
          // write message request to server
          String request = (String) iterator.next();
          if (request != null) _logger.info(timer.ellapsed(), "[SENT] {" + request + "}");
          protocol.write(request);
          // read message response from server
          response = protocol.read();
          if (response != null) _logger.info(timer.ellapsed(), "[RCVD] {" + response + "}");
        } finally {
          protocol.close();
        }
      }
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here


    Timer receiveTimer = new Timer();
    String response = null;
    boolean tooLongAlreadyDumped = false;
       
    try {
      CGISocket socket = createSocket();

      try {
        socket.setTimeout(timeout);
        request = transformRequest(request);
        socket.write(request);
        sendTimer.stop();
        logger.finer(sendTimer.ellapsed(), "[SENT] {" + request + "} (len=" + request.length() + ")");
        receiveTimer.start();
        response = socket.read();
        response = transformResponse(response);
                receiveTimer.stop();
      } finally {
        socket.close();
                totalTimer.stop();
      }
    } catch (InterruptedIOException e) {
      logger.error(e);
      // s� mostra o erro se a mensagem n�o tiver dados confidenciais (ex: login)
View Full Code Here

            try {
                Socket clientSocket = serverSocket.accept();

                if (_run) {
                    HostTestServerTask task = new HostTestServerTask(new CGISocket(clientSocket), _dir, _logger, _removesLineBreaks);
                    task.start();
                } else {
                    clientSocket.close();
                }
View Full Code Here

TOP

Related Classes of pt.opensoft.net.CGISocket

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.