mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-02-09 15:30:26 +01:00
* test/echo-client.c, test/echo-server.c: cheesy test clients. * configure.in (AC_CHECK_FUNCS): check for writev * dbus/dbus-message.c (_dbus_message_get_network_data): new function * dbus/dbus-list.c (_dbus_list_foreach): new function * dbus/dbus-internals.c (_dbus_verbose): new function * dbus/dbus-server.c, dbus/dbus-server.h: public object representing a server that listens for connections. * dbus/.cvsignore: create * dbus/dbus-errors.h, dbus/dbus-errors.c: public API for reporting errors * dbus/dbus-connection.h, dbus/dbus-connection.c: public object representing a connection that sends/receives messages. (Same object used for both client and server.) * dbus/dbus-transport.h, dbus/dbus-transport.c: Basic abstraction for different kinds of stream that we might read/write messages from.
41 lines
878 B
C
41 lines
878 B
C
#include <dbus/dbus.h>
|
|
#include <stdio.h>
|
|
#include "watch.h"
|
|
|
|
int
|
|
main (int argc,
|
|
char **argv)
|
|
{
|
|
DBusConnection *connection;
|
|
DBusResultCode result;
|
|
DBusMessage *message;
|
|
|
|
if (argc < 2)
|
|
{
|
|
fprintf (stderr, "Give the server address as an argument\n");
|
|
return 1;
|
|
}
|
|
|
|
connection = dbus_connection_open (argv[1], &result);
|
|
if (connection == NULL)
|
|
{
|
|
fprintf (stderr, "Failed to open connection to %s: %s\n",
|
|
argv[1], dbus_result_to_string (result));
|
|
return 1;
|
|
}
|
|
|
|
setup_connection (connection);
|
|
|
|
/* Send a message to get things going */
|
|
message = dbus_message_new ();
|
|
dbus_connection_send_message (connection,
|
|
message,
|
|
NULL);
|
|
dbus_message_unref (message);
|
|
|
|
do_mainloop ();
|
|
|
|
dbus_connection_unref (connection);
|
|
|
|
return 0;
|
|
}
|