<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi,<br>
    I use libnice inside a webrtc windows application in order to
    communicate (mainly) with chrome, using udp.<br>
    Since chrome 38 was released, I noticed a strange behaviour when the
    application is over internet.<br>
    Very often chrome stop sending data.<br>
    The reason signalled inside webrtc-internals is:<br>
    <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">ICEConnectionStateDisconnected</pre>
    I've implemented  the content of nice_debug (agent-priv.h), in order
    to have a log:<br>
    static __inline void nice_debug (const char *fmt, ...) {<br>
        FILE *ofp;<br>
        va_list argptr;<br>
        time_t mytime;<br>
        char s[1000];<br>
        struct tm * p;<br>
        SYSTEMTIME t;<br>
            <br>
        ofp = fopen("nice.log", "a");<br>
            <br>
        if (ofp){                        <br>
            va_start(argptr, fmt);<br>
            <br>
            GetSystemTime(&t);<br>
            fprintf(ofp,"%02d:%02d:%02d.%03d: ",t.wHour, t.wMinute,
    t.wSecond, t.wMilliseconds);<br>
    <br>
            vfprintf(ofp, fmt, argptr);<br>
            fprintf(ofp, "\n");<br>
            va_end(argptr);<br>
            fclose(ofp);<br>
    <br>
        }<br>
        <br>
    <br>
    }<br>
    <br>
    I discovered that systematically I got this condition:<br>
    ...<br>
    10:08:44.982: component_io_cb: 021C9010: received -1 valid messages
    with 0 bytes<br>
    <font color="#ff0000">10:08:45.063: ema g_socket_receive_message
      Error receiving message: The connection has been broken due to
      keep-alive activity detecting a failure while the operation was in
      progress.: 0</font><br>
    10:08:45.063: agent_recv_message_unlocked: Received -1 valid
    messages of length 0 from base socket 021C8248.<br>
    10:08:45.063: Agent 021C9010: agent_recv_message_unlocked returned
    -1, errno (0) : No error<br>
    10:08:45.063: component_io_cb: 021C9010: received -2 valid messages
    with 0 bytes<br>
    10:08:45.063: component_io_cb: error receiving message<br>
    10:08:45.142: Agent 021C9010 :STUN transaction retransmitted
    (timeout 397ms).<br>
    10:08:45.142: Agent 021C9010 :STUN transaction retransmitted
    (timeout 393ms).<br>
    10:08:45.542: Agent 021C9010 :STUN transaction retransmitted
    (timeout 798ms).<br>
    10:08:45.542: Agent 021C9010 :STUN transaction retransmitted
    (timeout 794ms).<br>
    10:08:45.822: Agent 021C9010 : timer tick #51: 0 frozen, 2
    in-progress, 0 waiting, 1 succeeded, 0 discovered, 1 nominated, 0
    waiting-for-nom.<br>
    <font color="#ff0000">10:08:46.342: Agent 021C9010 : Retransmissions
      failed, giving up on connectivity check 021E00D8</font><br>
    10:08:46.342: Agent 021C9010 : pair 021E00D8 state FAILED<br>
    10:08:46.342: Agent 021C9010 : Retransmissions failed, giving up on
    connectivity check 021DFB10<br>
    ...<br>
    <br>
    I found that this kind of error is related to ttl settings.<br>
    The default value on my windows machine is 128.<br>
    <br>
    Inside nice_udp_bsd_socket_new (udp-bsd.c) I've modified the ttl
    settings:<br>
    <br>
    ...<br>
    /* GSocket: All socket file descriptors are set to be close-on-exec.
    */<br>
      g_socket_set_blocking (gsock, false);<br>
      //ema<br>
      ttl=g_socket_get_ttl(gsock);<br>
      nice_debug ("ema g_socket_get_ttl before: %d", ttl);<br>
      g_socket_set_ttl(gsock,255);<br>
      ttl=g_socket_get_ttl(gsock);<br>
      nice_debug ("ema g_socket_get_ttl after: %d", ttl);<br>
    ...<br>
    <br>
    ttl is of guint type.<br>
    <br>
    With this modification I have no more problems.<br>
    I don't know the reason why I got this error because I think that
    the default value 128 should be enough.<br>
    Also maybe the patch has to be applied in other points of your code.<br>
    Maybe it could be better if you expose an API to configure ttl. I
    didn't' find a way to do it.<br>
    <br>
    I'm using libnice 0.1.7, but I get the same error using the new
    0.1.8.<br>
    <br>
    I hope that this report will be useful for someone else.<br>
    Please tell me if you want that I make other test in order to
    understand this kind of problem.<br>
    <br>
    <br>
    Thank you,<br>
    Emanuele<br>
    <br>
    <br>
    <br>
    <br>
    <br>
  </body>
</html>