Actually there is little mix up of codes. We have g_main_loop running which i guess works for listening to dbus socket also. And to catch the signal dbus_bus_add_match &amp; add_filter is used. So there is mix of dbus-glib bindings and some native code also. Does that might be causing the issue?<br>
<br>========== Sender Code ===========<br>DBusMessageIter iter, array_iter;<br>gchar           array_sig[2];<br>gint            i;<br>DBusError       error;<br>array_sig[0] = DBUS_TYPE_STRING;<br>array_sig[1] = &#39;\0&#39;;<br>
                <br>gchar *app_interface = g_strconcat (APP_MGR_DBUS_INTERFACE,&quot;.&quot;, application, NULL);<br>gchar *app_objectpath = g_strconcat (APP_MGR_DBUS_OBJECT, &quot;/&quot;, application, NULL);<br>                <br>
while (value) {<br>                    params[no_of_params] = g_strdup(value);<br>                        no_of_params++;<br>                        value = va_arg (args, char*);<br>                }<br><br>                dbus_error_init (&amp;error);<br>
                <br>                DBusConnection *bus_conn = dbus_bus_get (DBUS_BUS_SYSTEM, &amp;error);<br><br>                DBusMessage *msg = dbus_message_new_signal (app_objectpath, app_interface, APP_MGR_DBUS_SIGNAL_EXEC);<br>
                if(msg == NULL)<br>                {<br>                        g_critical(Not Enough Memory to create new dbus Message&quot;);<br>                        return -2;<br>                }<br>        <br>                dbus_message_iter_init_append(msg, &amp;iter);<br>
                dbus_message_iter_append_basic(&amp;iter, DBUS_TYPE_UINT32, &amp;no_of_params);<br>                dbus_message_iter_open_container(&amp;iter, DBUS_TYPE_ARRAY, array_sig, &amp;array_iter);<br>                dbus_message_iter_append_basic (&amp;array_iter, DBUS_TYPE_STRING, &amp;application);<br>
                <br>                for(i=1; i&lt;no_of_params; i++) {<br>                        dbus_message_iter_append_basic(&amp;array_iter, DBUS_TYPE_STRING, &amp;params[i]);<br>                }<br>                dbus_message_iter_close_container(&amp;iter, &amp;array_iter);<br>
<br>                if (!dbus_connection_send(bus_conn, msg, 0)) <br>                {<br>                        g_critical(&quot;Out Of Memory!&quot;);<br>                        return -3<br>                }<br><br>======================= Receiver code ==============<br>
<br>DBusConnection *connection = dbus_bus_get (DBUS_BUS_SYSTEM, &amp;error);<br>        if(!connection)<br>        {<br>                g_critical(&quot;Failed to connect to D-Bus Daemon: !&quot;);<br>                return -1;<br>
        }<br>gchar match_str1[MAX_SIZE] =  &quot;type=&#39;signal&#39;,interface=&#39;&quot;;<br>g_strlcat(match_str1, APP_MGR_DBUS_INTERFACE, MAX_SIZE);<br>g_strlcat(match_str1, &quot;&#39;&quot;, MAX_SIZE);<br>dbus_bus_add_match (appclient_context.bus_conn, match_str1, NULL);<br>
<br> dbus_connection_add_filter (appclient_context.bus_conn, message_func, NULL, NULL);<br><br>---------------------------- message_func ---------<br><br>static DBusHandlerResult<br>message_func (DBusConnection *bus_conn, DBusMessage *msg, gpointer user_data)<br>
{<br>    if (dbus_message_is_signal (msg, dbus_interface, APP_MGR_DBUS_SIGNAL_EXEC))<br>        {<br>                if(appclient_context.exec_callback!=NULL) {<br>                        DBusMessageIter iter, array_iter;<br>
                        guint no_of_param,i;<br>                        gchar *temp=NULL;<br>                        gchar **params_list=NULL;<br><br>                        dbus_message_iter_init(msg, &amp;iter);<br>                        dbus_message_iter_get_basic(&amp;iter, &amp;no_of_param);<br>
                        dbus_message_iter_next(&amp;iter);<br><br>                        if(((params_list = (gchar **)g_malloc0(((sizeof(gchar *))* no_of_param))) == NULL)) {<br>                                 (&quot;Out Of Memory!&quot;);<br>
                                return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;<br>                        }<br>                        if(no_of_param != 0)<br>                        {<br>                                dbus_message_iter_recurse(&amp;iter, &amp;array_iter);<br>
                                for(i=0; i&lt;no_of_param;i++)<br>                                {<br><br>                                        dbus_message_iter_get_basic(&amp;array_iter, &amp;temp);<br>                                        if(((params_list[i] = (gchar *)g_malloc0(strlen(temp) + 1 )) == NULL)) {<br>
                                                CLP_APPMGR_WARN(&quot;Out Of Memory!&quot;);<br>                                                CLP_APPMGR_EXIT_FUNCTION();<br>                                                return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;<br>
                                        }<br><br>                                        g_stpcpy (params_list[i], temp);<br>                                        CLP_APPMGR_INFO_V(&quot;Restore ( Param %u : %s )&quot;,i, params_list[i] );<br>
                                        dbus_message_iter_next(&amp;array_iter);<br>                                }<br>                        }<br>                        (appclient_context.exec_callback)(no_of_param, params_list);<br>
<br>                        for(i=0;i&lt;no_of_param;i++)<br>                                g_free(params_list[i]);<br>                        g_free(params_list);<br>                }<br>        }<br><br><br><br><br><br clear="all">
Cheers,<br>- Kaustubh <br><br>
<br><br><div class="gmail_quote">On Thu, Feb 26, 2009 at 2:21 PM, Thiago Macieira <span dir="ltr">&lt;<a href="mailto:thiago@kde.org">thiago@kde.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Em Quinta-feira 26 Fevereiro 2009, ŕs 08:24:34, Kaustubh Atrawalkar escreveu:<br>
<div class="Ih2E3d">&gt; I am using normal g_mail_loop for events integration in receiver side. And<br>
&gt; the regular method of add_match &amp; add_filter to poll on signals and read<br>
&gt; them. I was too suspecting on the socket getting full but I added some<br>
&gt; prints in - _dbus_connection_get_dispatch_status_unlocked . But can see<br>
&gt; number &quot;6&quot; most of the time as number of incoming connections.<br>
&gt; How can i avoid though if socket is getting full sometimes?<br>
<br>
</div>Sorry, I didn&#39;t understand one thing: are you using the dbus-glib binding or<br>
not?<br>
<br>
You mentioned integrating to g_main_loop, but you also said you were doing the<br>
integration work yourself. If that&#39;s the case, why are you integrating with<br>
glib yourself instead of using the binding?<br>
<br>
--<br>
<div class="Ih2E3d">Thiago Macieira - thiago (AT) <a href="http://macieira.info" target="_blank">macieira.info</a> - thiago (AT) <a href="http://kde.org" target="_blank">kde.org</a><br>
</div>  Senior Product Manager - Nokia, Qt Software<br>
<div><div></div><div class="Wj3C7c">      PGP/GPG: 0x6EF45358; fingerprint:<br>
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358<br>
</div></div><br>_______________________________________________<br>
dbus mailing list<br>
<a href="mailto:dbus@lists.freedesktop.org">dbus@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dbus" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dbus</a><br>
<br></blockquote></div><br>