![]() |
This module is under hard development phase and could be change completly.
Modules | |
watcher_internal | |
Functions | |
int | easydbus_send_method_withReply_Blocking (struct EasyDbus_core *core, DBusMessage *msg, struct EasyDbus_method *method, int timeout) |
Send DBusMessage message and blocking for reply. |
int easydbus_send_method_withReply_Blocking | ( | struct EasyDbus_core * | core, | |
DBusMessage * | msg, | |||
struct EasyDbus_method * | method, | |||
int | timeout | |||
) | [inline] |
Send DBusMessage message and blocking for reply.
core | EasyDbus_core object pointer | |
msg | DBusMessage to send | |
method | EasyDbus_method object pointer where is saved reply | |
timeout | timeout on wait for a reply. |
0 ok
For internal use only.
Definition at line 55 of file watch_events_internal.c.
References EasyDbus_core::conn, easydbus_reply_build_error(), easydbus_reply_build_struct(), and EasyDbusDebug.
Referenced by easydbus_method_send_blocking().
00059 { 00060 int ret_val = 0; 00061 DBusError err; 00062 00063 dbus_connection_flush (core->conn); 00064 dbus_error_init (&err); 00065 00066 DBusMessage *reply = 00067 dbus_connection_send_with_reply_and_block (core->conn, 00068 msg, timeout, &err); 00069 00070 dbus_connection_flush (core->conn); 00071 00072 if (dbus_error_is_set (&err)) { 00073 EasyDbusDebug ("Received error reply: %s\n", err.message); 00074 easydbus_reply_build_error (method, err.message); 00075 ret_val = -1; 00076 goto exit_; 00077 } 00078 00079 EasyDbusDebug ("REPLY: %s Message: member = %s\n" 00080 "interface = %s\n" 00081 "path = %s\n", 00082 dbus_message_type_to_string (dbus_message_get_type 00083 (reply)), 00084 dbus_message_get_member (reply), 00085 dbus_message_get_interface (reply), 00086 dbus_message_get_path (reply)); 00087 00088 if (easydbus_reply_build_struct (method, reply)) { 00089 ret_val = -1; 00090 goto exit_; 00091 } 00092 00093 dbus_error_free (&err); 00094 00095 exit_: 00096 /* see if is needed */ 00097 if (reply != NULL) 00098 dbus_message_unref (reply); 00099 dbus_error_free (&err); 00100 return ret_val; 00101 }