Examples of waitForResponse()


Examples of ch.ethz.inf.vs.californium.coap.Request.waitForResponse()

      do {
 
        // receive response
        Response response = null;
        try {
          response = request.waitForResponse();
        } catch (InterruptedException e) {
          System.err.println("Failed to receive response: " + e.getMessage());
          System.exit(ERR_RESPONSE_FAILED);
        }
 
View Full Code Here

Examples of ch.ethz.inf.vs.californium.coap.Request.waitForResponse()

      }
      Response response = null;
     
      try {
        validationRequest.send();
        response = validationRequest.waitForResponse();
       
      } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
View Full Code Here

Examples of ch.ethz.inf.vs.californium.coap.Request.waitForResponse()

      Request asyncRequest = new Request(Code.PUT, Type.CON);
      asyncRequest.setPayload(newValue, contentType);
      asyncRequest.setURI(uri);
      asyncRequest.send();

      response = asyncRequest.waitForResponse(6000);

      // checking the response
      if (response != null) {
        success &= checkInt(EXPECTED_RESPONSE_CODE_1.value, response.getCode().value, "code");
      }
View Full Code Here

Examples of ch.ethz.inf.vs.californium.coap.Request.waitForResponse()

                  System.out.println("+++++ Unrelated GET +++++");
            // GET with different Token
            Request asyncRequest = Request.newGet();
            asyncRequest.setURI(uri);
            asyncRequest.send();
            response = asyncRequest.waitForResponse(time/2);
            if (response!=null) {
              success &= checkToken(asyncRequest.getToken(), response.getToken());
              success &= hasObserve(response, true); // inverted
                      System.out.println("+++++ OK +++++");
            } else {
View Full Code Here

Examples of ch.ethz.inf.vs.californium.coap.Request.waitForResponse()

     
      request.send();
     
      // receive response
      try {
        Response response = request.waitForResponse(1000);
       
        if (response != null) {
          // response received, output a pretty-print
          System.out.println(response);
        } else {
View Full Code Here

Examples of ch.ethz.inf.vs.californium.coap.Request.waitForResponse()

  public static void selfTest() {
    try {
      Request request = Request.newGet();
      request.setURI("localhost:5683/benchmark");
      request.send();
      Response response = request.waitForResponse(1000);
      System.out.println("received "+response);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of ch.ethz.inf.vs.californium.coap.Request.waitForResponse()

  public static void selfTest() {
    try {
      Request request = Request.newGet();
      request.setURI("localhost:5683/hello");
      request.send();
      Response response = request.waitForResponse(1000);
      System.out.println("received "+response);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of ch.ethz.inf.vs.californium.coap.Request.waitForResponse()

      return new Response(ResponseCode.INTERNAL_SERVER_ERROR);
    }

    try {
      // receive the response // TODO: don't wait for ever
      Response receivedResponse = outgoingRequest.waitForResponse();

      if (receivedResponse != null) {
        LOGGER.finer("Coap response received.");

        // create the real response for the original request
View Full Code Here

Examples of org.apache.xmlrpc.client.TimingOutCallback.waitForResponse()

    }
   
    long startTime = System.currentTimeMillis();
    _client.executeAsync("OvmDispatch", mParams, callback);
    try {
      return callback.waitForResponse();
    } catch (TimingOutCallback.TimeoutException to) {
      throw to;
    } catch (Throwable e) {
      throw new XmlRpcException(-2, e.getMessage());
    } finally {
View Full Code Here

Examples of org.apache.xmlrpc.client.TimingOutCallback.waitForResponse()

        TimingOutCallback toc = new TimingOutCallback(5000);
        final String methodName = XMLRPC89Handler.class.getName() + ".reverse";
        client.executeAsync(methodName, new Object[]{new Object[]{"1", "2", "3"}}, toc);
        Object o;
        try {
            o = toc.waitForResponse();
        } catch (Exception e) {
            throw e;
        } catch (Throwable t) {
            throw new UndeclaredThrowableException(t);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.