Package org.red5.server.api

Examples of org.red5.server.api.IClient


  @Test
  public void client() {
    log.debug("-----------------------------------------------------------------client");
    IClientRegistry reg = context.getClientRegistry();
    IClient client = reg.newClient(null);
    assertTrue("client should not be null", client != null);
  }
View Full Code Here


    // add the connection to thread local
    Red5.setConnectionLocal(conn);
    // resolve root
    IScope scope = context.resolveScope("/");
    IClientRegistry reg = context.getClientRegistry();
    IClient client = reg.newClient(null);
    assertNotNull(client);
    conn.initialize(client);
    if (conn.connect(scope)) {
      assertTrue("should have a scope", conn.getScope() != null);
      conn.close();
View Full Code Here

    TestConnection conn = new TestConnection(host, "/junit", null);
    Red5.setConnectionLocal(conn);

    IClientRegistry reg = context.getClientRegistry();
    IClient client = reg.newClient(null);
    assertTrue("client should not be null", client != null);
    log.debug("{}", client);
    String key = "key";
    String value = "value";
    client.setAttribute(key, value);
    assertTrue("attributes not working", client.getAttribute(key) == value);

    conn.initialize(client);

    if (conn.connect(testApp)) {
      // give connect a moment to settle
View Full Code Here

    IScope room5 = ScopeUtils.resolveScope(appScope, "/junit/room1/room4/room5");
    log.debug("Room 5 scope: {}", room5);
    // test section for issue #259
    // a little pre-setup is needed first
    IClientRegistry reg = context.getClientRegistry();
    IClient client = reg.newClient(null);
    TestConnection conn = new TestConnection(host, appPath, client.getId());
    conn.initialize(client);
    Red5.setConnectionLocal(conn);
    assertTrue(conn.connect(room5));
    // their code
    IScope scope = Red5.getConnectionLocal().getScope();
View Full Code Here

    if (connectionScope != null) {
      // Get client registry for connection scope
      IClientRegistry clientRegistry = connectionScope.getContext().getClientRegistry();
      log.debug("Client registry: {}", (clientRegistry == null ? "is null" : "not null"));
      if (clientRegistry != null) {
        IClient client = conn.getClient();
        if (client == null) {
          if (!clientRegistry.hasClient(id)) {
              if (conn instanceof RTMPTConnection) {
                log.debug("Creating new client for RTMPT connection");
                // create a new client using the session id as the client's id
View Full Code Here

    }
  }

  @Test
  public void testNewClient() {
    IClient client = reg.newClient(null);
    assertNotNull(client);
    assertTrue(client.getId() != null);
    assertTrue(Integer.valueOf(client.getId()) >= 0);
  }
View Full Code Here

    assertTrue(reg.getClients().size() >= 1);
  }

  @Test
  public void testLookupClient() {
    IClient client = reg.lookupClient("0");
    assertNotNull(client);
  }
View Full Code Here

    assertNotNull(client);
  }

  @Test
  public void testGetClient() {
    IClient client = reg.getClient("0");
    assertNotNull(client);
    IClient client2 = null;
    try {
      client2 = reg.getClient("999999");
      fail("An exception should occur here");
    } catch (ClientNotFoundException e) {
      assertTrue(true);
View Full Code Here

    assertTrue(reg.getClients().size() >= 10);
  }

  @Test
  public void testRemoveClient() {
    IClient client = reg.lookupClient("5");
    assertNotNull(client);
    reg.removeClient(client);
    IClient client2 = null;
    try {
      client2 = reg.getClient("5");
      fail("An exception should occur here");
    } catch (ClientNotFoundException e) {
      assertTrue(true);
View Full Code Here

    MultiThreadedTestRunner mttr = new MultiThreadedTestRunner(trs);
    long start = System.nanoTime();
    mttr.runTestRunnables();
    System.out.printf("Runtime: %s ns\n", (System.nanoTime() - start));
    for (TestRunnable r : trs) {
      IClient cli = ((ClientCreatorWorker) r).getClient();
      assertTrue(cli == null);
    }
    System.gc();
    System.out.printf("Free mem diff at end: %s\n", Math.abs(startFreeMem - rt.freeMemory()));
  }
View Full Code Here

TOP

Related Classes of org.red5.server.api.IClient

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.