Examples of KeepaliveManager


Examples of com.kurento.kmf.jsonrpcconnector.KeepAliveManager

    server = new ThriftServer(clientProcessor, executorService,
        localHandlerAddress);

    server.start();

    keepAliveManager = new KeepAliveManager(this,
        KeepAliveManager.Mode.PER_CLIENT);

    keepAliveManager.start();
  }
View Full Code Here

Examples of com.kurento.kmf.jsonrpcconnector.KeepAliveManager

    if (client instanceof JsonRpcClientThrift) {
      client.getKeepAliveManager().stop();
      client.setKeepAliveManager(null);

      keepAliveManager = new KeepAliveManager(client,
          KeepAliveManager.Mode.PER_ID_AS_SESSION);

      keepAliveManager.start();
    }
  }
View Full Code Here

Examples of com.kurento.kmf.jsonrpcconnector.KeepAliveManager

          Continuation<Response<JsonElement>> continuation) {
        internalSendRequestBroker(request, resultClass, continuation);
      }
    };

    keepAliveManager = new KeepAliveManager(this,
        KeepAliveManager.Mode.PER_ID_AS_MEDIAPIPELINE);

    keepAliveManager.start();
  }
View Full Code Here

Examples of com.kurento.kmf.jsonrpcconnector.KeepAliveManager

  @Test
  public void oneSessionTest() throws InterruptedException {

    JsonRpcClientKeepAliveController controller = new JsonRpcClientKeepAliveController();

    KeepAliveManager keepAliveManager = new KeepAliveManager(
        controller.getClient(), KEEPALIVE_INTERVAL_TIME,
        KeepAliveManager.Mode.PER_CLIENT);

    keepAliveManager.start();

    long duration = controller.waitForEvents(3);

    Assert.assertTrue(duration + MARGIN_TIME > KEEPALIVE_INTERVAL_TIME
        * NUM_KEEP_ALIVES);

    keepAliveManager.stop();
  }
 
View Full Code Here

Examples of com.kurento.kmf.jsonrpcconnector.KeepAliveManager

  @Test
  public void oneMediaPipelineTest() throws InterruptedException {

    JsonRpcClientKeepAliveController controller = new JsonRpcClientKeepAliveController();

    KeepAliveManager keepAliveManager = new KeepAliveManager(
        controller.getClient(), KEEPALIVE_INTERVAL_TIME,
        KeepAliveManager.Mode.PER_ID_AS_SESSION);

    keepAliveManager.start();

    Thread.sleep(KEEPALIVE_INTERVAL_TIME * 2);

    Assert.assertTrue(
        "KeepAliveManager in pipeline mode without pipelines shouldn't send any keepAlive event",
        controller.clearEvents() == 0);

    keepAliveManager.addId("XXXXX");

    Thread.sleep(KEEPALIVE_INTERVAL_TIME * 3);

    Assert.assertTrue("keepAlive events should be at least 2",
        controller.clearEvents() >= 2);

    keepAliveManager.stop();
  }
View Full Code Here

Examples of com.kurento.kmf.jsonrpcconnector.KeepAliveManager

  @Test
  public void addRemovePipelinesTest() throws InterruptedException {

    JsonRpcClientKeepAliveController controller = new JsonRpcClientKeepAliveController();

    KeepAliveManager keepAliveManager = new KeepAliveManager(
        controller.getClient(), KEEPALIVE_INTERVAL_TIME,
        KeepAliveManager.Mode.PER_ID_AS_SESSION);

    keepAliveManager.start();

    String mediaPipelineIdA = "XXXXX";
    String mediaPipelineIdB = "YYYYY";

    keepAliveManager.addId(mediaPipelineIdA);
    keepAliveManager.addId(mediaPipelineIdB);

    Thread.sleep(KEEPALIVE_INTERVAL_TIME * 3);

    Assert.assertTrue("keepAlive events should be at least 2 x 2 = 4",
        controller.clearEvents() >= 4);

    keepAliveManager.removeId(mediaPipelineIdA);
    keepAliveManager.removeId(mediaPipelineIdB);

    Thread.sleep(KEEPALIVE_INTERVAL_TIME);
    log.info("Removed media pipelines and wait a keepAliveIntervalTime");

    controller.clearEvents();
    log.info("Cleared events after removing media pipelines");

    Thread.sleep(KEEPALIVE_INTERVAL_TIME * 3);

    Assert.assertTrue(
        "keepAliveManager without pipelines shouldn't send keepAlives",
        controller.clearEvents() == 0);

    keepAliveManager.stop();
  }
View Full Code Here

Examples of freenet.client.connection.KeepaliveManager

    // It is not needed, but may come handy in the future
    exportStaticMethod();

    requestId = RootPanel.get("requestId").getElement().getAttribute("value");
    cm = new SharedConnectionManager(new DefaultUpdateManager());
    keepaliveManager = new KeepaliveManager();
    cm.openConnection();
    keepaliveManager.openConnection();
    new TimeIncrementer().start();
    // Create the MessageManager object to let it register it's listener
    MessageManager.get();
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.