[libnice] udp ttl on windows

Emanuele Bizzarri emabiz76 at gmail.com
Mon Oct 27 05:00:37 PDT 2014

I moved on 0.1.8 so should be easy for you make the needed modifications.
In my response I have also added all the steps needed to make this 
version compilable under windows and vc2010 (in addition to README.win32)

1. remove ref to ..\..\socket\turn.c inside the project (maybe it is an 
old ref)
2. remove ref to ..\..\socket\tcp-turn.c inside the project (maybe it is 
an old ref)
3. remove ref to ..\..\socket\tcp-turn.h inside the project (maybe it is 
an old ref)
4. copy inttypes.h into sln dir
5. replace all inline with __inline
6. add udp_turn.c and udp_turn.h to the project
7. add tcp_active.c and tcp_active.h to the project
8. ad tcp_passive.c and tcp_passive.h to the project
9.add udp-turn-over-tcp.c and udp-turn-over-tcp.h to the project
10.add iostream.c and iostream.h to the project
11.add inputstream.c and inputstream.h to the project
12.add outputstream.c and outputstream.h to the project

13.replace into stun_debug_bytes (debug.c):
//char bytes[prefix_len + 2 + (len * 2) + 1];
char bytes[1000];//ema
and replace snprintf with _snprintf

Attached you can find log and wireshark.

I can reproduce the problem.
The point start from:
** (ewmcu_console.exe:4932): DEBUG: component_io_cb: 020EA018: received 
-2 valid messages with 0 bytes

In my previous test, using the modified code I saw that the reason why 
the receive function returns -2 is:
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

If you set ttl=255, the problem disappears.

Thank you,


On 24/10/2014 18:24, Philip Withnall wrote:
> Hi,
> On Thu, 2014-10-23 at 15:10 +0200, Emanuele Bizzarri wrote:
>> I've implemented  the content of nice_debug (agent-priv.h), in order
>> to have a log:
> You shouldn’t have to do that. Just make sure you’re not defining NDEBUG
> in CPPFLAGS anywhere, and the default implementation of nice_debug() in
> debug.c should be used automatically.
>> I found that this kind of error is related to ttl settings.
>> The default value on my windows machine is 128.
> That’s weird, and as you say, a TTL of 128 should be high enough for
> anything.
> Could you possibly attach a full libnice log (run your program with
> NICE_DEBUG=all G_MESSAGES_DEBUG=all after compiling it with NDEBUG
> undefined) and a Wireshark log of the problem please? If they’re big,
> please e-mail them to me personally rather than the entire list.
> Thanks,
> Philip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/nice/attachments/20141027/8a091b8f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log.zip
Type: application/x-zip-compressed
Size: 208209 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/nice/attachments/20141027/8a091b8f/attachment-0001.bin>

More information about the nice mailing list