Hi Youness,<br>Thanks for your reply! yes, I check my code again 
according your suggestion,and I find a mistake, I set the wrong password
 when I use nice_agent_set_remote_<div id=":4f" class="ii gt">credentials function. After I 
correctting this mistake, <span class="il">libnice</span> works very 
well!<br>
<br>thans for your help!</div><br><br><div class="gmail_quote">2010/6/12 Youness Alaoui <span dir="ltr">&lt;<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
First, I notice the Username/password are both NULL in your candidates.. maybe<br>
you didn&#39;t set them correctly ? or if you&#39;re using the RFC compatibility mode,<br>
did you call the nice_agent_set_remote_credentials function ?<br>
You&#39;re not giving me enough information to understand your issue.. I don&#39;t know<br>
the compatibility mode you used, I don&#39;t have the logs from both sides either,<br>
make sure both sides are setting their candidates properly.<br>
Also, it fails to establish the connection because it doesn&#39;t receive any data..<br>
did you call the nice_agent_attach_recv function properly ?<br>
I also noticed that the only candidate you have is 10.1.31.222 which seems to be<br>
a local candidate, if the call is not being made inside the same local netword,<br>
then it won&#39;t work, you might need to set the STUN server on your agent for it<br>
to do proper NAT traversal.<br>
<br>
Youness.<br>
<div><div></div><div class="h5"><br>
jiayu zeng wrote:<br>
&gt; Hi all,<br>
&gt;       I use libnice0.0.12 in our project to do NAT traversing, however<br>
&gt; there is a problem.<br>
&gt;      when I get peer&#39;s candidates and then using<br>
&gt; nice_agent_set_remote_candidates() to set candidates, however the<br>
&gt; connection check always fail! here is the debug message:<br>
&gt;<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868: set_remote_candidates 1 1<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : Adding remote<br>
&gt; candidate with addr [10.1.31.222]:56708 for s1/c1. U/P &#39;(null)&#39;/&#39;(null)&#39;<br>
&gt; prio: 152912400<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : creating new pair<br>
&gt; 0x91e5e28 state 5<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : Adding remote<br>
&gt; candidate with addr [10.1.31.222]:56708<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : added a new conncheck<br>
&gt; 0x91e5e28 with foundation of &#39;1:1&#39; to list 1.<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : stream 1 component 1<br>
&gt; STATE-CHANGE 1 -&gt; 2.<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : Pair 0x91e5e28 with<br>
&gt; s/c-id 1/1 (1:1) unfrozen.<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : pair 0x91e5e28 state<br>
&gt; WAITING remote candidate addr[10.1.31.222]:56708<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 :<br>
&gt; priv_conn_check_unfreeze_next returned 1<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : pair 0x91e5e28 state<br>
&gt; IN_PROGRESS<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 :  remote candidate with<br>
&gt; addr [10.1.31.222]:56708<br>
&gt; (process:18123): libnice-DEBUG: pair 0x91e5e28 Agent 0x91bb868 : STUN-CC<br>
</div></div>&gt; REQ to &#39;10.1.31.222 &lt;<a href="http://10.1.31.222" target="_blank">http://10.1.31.222</a>&gt;:34013&#39;, socket=8, pair=1:1<br>
<div><div></div><div class="h5">&gt; (c-id:1), tie=16361108746083089059, username=&#39;l=\u001c    &#39; (0),<br>
&gt; password=&#39;&#39; (0), priority=1845494271.<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : STUN connectivity<br>
&gt; check was cancelled, marking as done.<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : pair 0x91e5e28 state<br>
&gt; FAILED<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : timer tick #1: 0<br>
&gt; frozen, 0 in-progress, 0 waiting, 0 succeeded, 0 discovered, 0<br>
&gt; nominated, 0 waiting-for-nom.<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 :<br>
&gt; priv_conn_check_tick_unlocked returned 1<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 :<br>
&gt; conn_check_schedule_next returning 1<br>
&gt;<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : timer tick #2: 0<br>
&gt; frozen, 0 in-progress, 0 waiting, 0 succeeded, 0 discovered, 0<br>
&gt; nominated, 0 waiting-for-nom.<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 :<br>
&gt; priv_conn_check_tick_unlocked: stopping conncheck timer<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : stream 1 component 1<br>
&gt; STATE-CHANGE 2 -&gt; 5.<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : conn.check list<br>
&gt; status: 0 nominated, 0 succeeded, c-id 1.<br>
&gt; (process:18123): libnice-DEBUG: Agent 0x91bb868 : changing conncheck<br>
&gt; state to COMPLETED.<br>
&gt;<br>
&gt; I found that the peer&#39;s port is erro in the debug message, and then I<br>
&gt; find a debug bug in conncheck.c line 1657,should we use ntohs here??but<br>
&gt; this is not the essencial problem. I use netstat -aun in peer, and I<br>
&gt; find the udp port 56708 is opend,but why the connection check always fail?<br>
&gt;<br>
&gt; I&#39;m soory for my poor english, but hope you can understand what I say:)<br>
&gt;<br>
&gt; thanks a lot!<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Nice mailing list<br>
&gt; <a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a><br>
&gt; <a href="http://lists.freedesktop.org/mailman/listinfo/nice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/nice</a><br>
<br>
<br>
</blockquote></div><br>