summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-connection-internal.h
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-08-15 04:17:58 +0000
committerHavoc Pennington <hp@redhat.com>2003-08-15 04:17:58 +0000
commitef614207fc4f03e5cc02faeb109f739eb1ccdf31 (patch)
tree8e32a70a0094c6605c29f2f2ed99075b6fc0d483 /dbus/dbus-connection-internal.h
parenta6c8a71b1bcba04b63812a61f668e87af0922e5e (diff)
2003-08-15 Havoc Pennington <hp@pobox.com>
* dbus/dbus-connection.c, dbus/dbus-pending-call.c: Finish the pending call stuff
Diffstat (limited to 'dbus/dbus-connection-internal.h')
-rw-r--r--dbus/dbus-connection-internal.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h
index 423df5f8..d9d5c5b4 100644
--- a/dbus/dbus-connection-internal.h
+++ b/dbus/dbus-connection-internal.h
@@ -29,6 +29,7 @@
#include <dbus/dbus-transport.h>
#include <dbus/dbus-resources.h>
#include <dbus/dbus-list.h>
+#include <dbus/dbus-timeout.h>
DBUS_BEGIN_DECLS;
@@ -39,6 +40,9 @@ typedef enum
DBUS_ITERATION_BLOCK = 1 << 2 /**< Block if nothing to do. */
} DBusIterationFlags;
+/** default timeout value when waiting for a message reply */
+#define _DBUS_DEFAULT_TIMEOUT_VALUE (15 * 1000)
+
void _dbus_connection_lock (DBusConnection *connection);
void _dbus_connection_unlock (DBusConnection *connection);
void _dbus_connection_ref_unlocked (DBusConnection *connection);
@@ -85,6 +89,47 @@ DBusHandlerResult _dbus_message_handler_handle_message (DBusMessageHandl
void _dbus_connection_init_id (DBusConnection *connection,
DBusObjectID *id);
+DBusPendingCall* _dbus_pending_call_new (DBusConnection *connection,
+ int timeout_milliseconds,
+ DBusTimeoutHandler timeout_handler);
+
+void _dbus_pending_call_notify (DBusPendingCall *pending);
+
+void _dbus_connection_remove_pending_call (DBusConnection *connection,
+ DBusPendingCall *pending);
+
+/**
+ * @addtogroup DBusPendingCallInternals DBusPendingCall implementation details
+ * @{
+ */
+/**
+ * @brief Internals of DBusPendingCall
+ *
+ * Object representing a reply message that we're waiting for.
+ */
+struct DBusPendingCall
+{
+ DBusAtomic refcount; /**< reference count */
+
+ DBusPendingCallNotifyFunction function; /**< Notifier when reply arrives. */
+ void *user_data; /**< user data for function */
+ DBusFreeFunction free_user_data; /**< free the user data */
+
+ DBusConnection *connection; /**< Connections we're associated with */
+ DBusMessage *reply; /**< Reply (after we've received it) */
+ DBusTimeout *timeout; /**< Timeout */
+
+ DBusList *timeout_link; /**< Preallocated timeout response */
+
+ dbus_uint32_t reply_serial; /**< Expected serial of reply */
+
+ unsigned int completed : 1; /**< TRUE if completed */
+ unsigned int timeout_added : 1; /**< Have added the timeout */
+};
+
+/** @} End of DBusPendingCallInternals */
+
+
DBUS_END_DECLS;
#endif /* DBUS_CONNECTION_INTERNAL_H */