I've been working on the following test program... My goal for now was 
just to see the callbacks fire as I gathered local candidates...<br><br>Unfortunately,
 I must be doing something wrong because my stund server never gets hit 
and the only candidate type I detect is HOST... <br>
<br>I&#39;m 
pretty sure there is something wrong with my code (as opposed to my stun
 server) because I can run a stun command line client against my server 
and the server gets hit (i know because it prints a bunch of stuff)... 
Any ideas?<br> <br>   td<br><br>#include &lt;stdio.h&gt;<br><br>extern &quot;C&quot;<br>{<br>#include &lt;glib.h&gt;<br>#include &lt;nice/nice.h&gt;<br>}<br><br>GMainContext* mainContext = NULL;<br>GMainLoop* mainLoop = NULL;<br>
NiceAgent* niceAgent = NULL;<br>NiceAddress baseAddress;<br>guint streamId = 0;<br>GSList* localCandidates = NULL;<br><br>[... cut a bunch of callback functions that just basically printed that they were called ...]<br><br>
int main( int argc, char* argv[] )<br>{<br>    g_type_init();<br>    g_thread_init( NULL );<br><br><br>    // Create a glib application context and mainloop bject...<br>    //<br>    <br>    mainContext = g_main_context_new();<br>
    <br>    mainLoop = g_main_loop_new( mainContext, FALSE );<br>    <br><br>    // Create our main nice agent...<br>    //<br>    <br>    niceAgent = nice_agent_new( mainContext, NICE_COMPATIBILITY_RFC5245 );<br><br>    <br>
    // Specify which local interface to use...<br>    //<br>    <br>    nice_address_set_from_string( &amp;baseAddress, &quot;127.0.0.1&quot; );<br>    nice_agent_add_local_address( niceAgent, &amp;baseAddress );<br><br>    <br>
    // Connect callback functions...<br>    //<br>    <br>    g_signal_connect( G_OBJECT( niceAgent ),<br>                      &quot;candidate-gathering-done&quot;,<br>                      G_CALLBACK( cb_candidate_gathering_done ),<br>
                      GUINT_TO_POINTER(1) );<br><br>    g_signal_connect( G_OBJECT( niceAgent ),<br>                      &quot;component-state-changed&quot;,<br>                      G_CALLBACK( cb_component_state_changed ),<br>
                      GUINT_TO_POINTER(1) );<br><br>    g_signal_connect( G_OBJECT( niceAgent ),<br>                      &quot;initial-binding-request-received&quot;,<br>                      G_CALLBACK( cb_initial_binding_request_received ),<br>
                      GUINT_TO_POINTER(1) );<br><br>    g_signal_connect( G_OBJECT( niceAgent ),<br>                      &quot;new-candidate&quot;,<br>                      G_CALLBACK( cb_new_candidate ),<br>                      GUINT_TO_POINTER(1) );<br>
<br>    g_signal_connect( G_OBJECT( niceAgent ),<br>                      &quot;new-remote-candidate&quot;,<br>                      G_CALLBACK( cb_new_remote_candidate ),<br>                      GUINT_TO_POINTER(1) );<br>
<br>    g_signal_connect( G_OBJECT( niceAgent ),<br>                      &quot;new-selected-pair&quot;,<br>                      G_CALLBACK( cb_new_selected_pair ),<br>                      GUINT_TO_POINTER(1) );<br><br>
    g_signal_connect( G_OBJECT( niceAgent ),<br>                      &quot;reliable-transport-writable&quot;,<br>                      G_CALLBACK( cb_reliable_transport_writable ),<br>                      GUINT_TO_POINTER(1) );<br>
<br><br>    // Configure Stun server information...<br>    //<br><br>    g_object_set( G_OBJECT( niceAgent ), &quot;stun-server&quot;, &quot;<a href="http://test.com">test.com</a>&quot;, NULL );<br>    g_object_set( G_OBJECT( niceAgent ), &quot;stun-server-port&quot;, 3478, NULL );<br>
<br>    <br>    // Create a &quot;stream&quot; and attach it to our agent...<br>    //<br><br>    streamId = nice_agent_add_stream( niceAgent, 1 );<br><br>    g_object_set_data( G_OBJECT( niceAgent ), &quot;id&quot;, GUINT_TO_POINTER(streamId) );<br>
<br><br>    // Begin the local candidate gathering process...<br>    //<br>    <br>    nice_agent_gather_candidates( niceAgent, streamId );<br><br><br>    // attach recv callback handler...<br>    //<br>    <br>    nice_agent_attach_recv( niceAgent,<br>
                            streamId,<br>                            1,<br>                            mainContext,<br>                            cb_nice_recv,<br>                            GUINT_TO_POINTER(1) );<br><br>
<br><br>    // Finally, start the glib MainLoop so we can start receiving events...<br>    //<br>    <br>    g_main_loop_run( mainLoop );<br><br>    while( g_main_loop_is_running( mainLoop ) );<br>    <br>    g_object_unref( niceAgent );<br>
    <br>    return 0;<br>}<br><br>