/** Parse the listenpoint from XML element */
 @Override
 public void parseFromXml(Element root, Runner runner) throws Exception {
   super.parseFromXml(root, runner);
   if (root.element("srtpSender") != null) {
     this.parseSRTPSender(root, 0);
   }
   if (root.element("srtpReceiver") != null) {
     this.parseSRTPSender(root, 1);
   }
 }
Example #2
0
  public static void putHashmap() throws Exception {
    Stack stack = new StackUdp();

    long maxIter = 50000;
    logger.debug(TextEvent.Topic.PROTOCOL, "maxIter : " + maxIter);
    long beginTT = new GregorianCalendar().getTimeInMillis();

    // Listenpoint lp = new ListenpointUdp(stack);
    for (int i = 1; i <= maxIter; i++) {
      // Create a SIP message object corresponding to the string message
      if (i % 1000 == 0) {
        System.out.println("i=" + i);
      }
      int port = 11000 + i;
      Listenpoint lp = new ListenpointUdp(stack, "name" + i, "172.16.21.32", port);
      listenpoints.put(lp.getName(), lp);
      lp.create(StackFactory.PROTOCOL_SIP);
    }
    long endTT = new GregorianCalendar().getTimeInMillis();
    float duration = ((float) (endTT - beginTT)) / 1000;
    float flow = maxIter / duration;
    System.out.println("duration = " + duration + " s.");
    System.out.println("trans flow = " + flow + " trans/s.");
  }