Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


peers-js delay on web actions

  • pabloandres

    Hi yohannmartineau,

    first of all great work!

    I downloaded the svn trunk version of the project a couple of days ago.
    I'm currently working with the peers-js and having an small but annoying problem.

    When i click on the "call" button it takes 5 secs to actually make the call.
    Doing some debug and research on the code, I found that on method UdpMessageSender.sendBytes

           try {
                System.out.println(dateFormat.format(new Date())   " UdpMessageSender.sendBytes b");
                System.out.println(dateFormat.format(new Date())   " UdpMessageSender.sendBytes a");
            } catch (Throwable t) {
                logger.error("throwable", new Exception(t));

    the datagramSocket.send(packet); takes almost 5 seconds.

    2012-06-15- 19:13:44:770 ::: UdpMessageSender.sendBytes
    2012-06-15- 19:13:44:770 ::: UdpMessageSender.sendBytes packet created
    2012-06-15- 19:13:44:770 ::: UdpMessageSender.sendBytes b
    2012-06-15- 19:13:49:818 ::: UdpMessageSender.sendBytes a

    I also implemented the "terminate button" on the web and the same happens.
    But the weird thing is that it only happens when i issue any action from the web side. But when for example the ringing message is sent by the applications, it's sended instantly.

    Do you have any clue on what could be happening?

    Thanks in advance.

  • pabloandres

    Let me add.. both client and server are on the same lan.
    And client java:

    java version "1.6.0_23"
    OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10.2)
    OpenJDK Server VM (build 20.0-b11, mixed mode)

    OS: Ubuntu 11.10

    Let me know if you need some additional info.
    Best regards

  • I added those catch throwable because i had an issue while sending packets (a security issue iirc). Unfortunately, I don't know why you're getting those delays. My security exception was also coming from web integration. With jnlp and standalone versions, no problem. I wonder if it's browser related. Did you make a test on IE on a windows pc? I think there's a sort of security scanner embedded in firefox or chrome and maybe this security scanner is slowing down the first packets sent…

  • pabloandres

    Hi yohannmartineau, thanks for replying.

    I tested on a windows pc and there is no delay. So maybe it's OS related and I think there's nothing I can do to avoid it. Anyway I'll let you know if I find something else.

    Thanks again.
    Best Regards

  • pabloandres


    It wasn't OS related. It was about the JDK.
    I removed OpenJDK and installed oracle-jdk7-installer and it started working ok.
    My Java version now

    java version "1.7.0_05"
    Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
    Java HotSpot(TM) Server VM (build 23.1-b03, mixed mode)

    For those people that work with Ubuntu and OpenJDK, these are the steps I follow to move to oracle-jdk

    1. Add repository to /etc/apt/sources.liist

    deb http://ppa.launchpad.net/webupd8team/java/ubuntu  main

    2. Install oracle-jdk7-installer

    sudo apt-get update
    sudo apt-get install oracle-jdk7-installer

    And ready to go..

    pablo@devel220:~$ java -version
    java version "1.7.0_05"
    Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
    Java HotSpot(TM) Server VM (build 23.1-b03, mixed mode)

    It updates also the borwser plugin.

    Hope it helps.
    Best Regards.

  • great !

    good to know that it works now.