diff options
author | Havoc Pennington <hp@redhat.com> | 2003-04-07 01:07:13 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-04-07 01:07:13 +0000 |
commit | 98572905e60cac7ea971aa0830e2a629bfff208d (patch) | |
tree | 2e3ebcfe8670fc403ac4262c96fa714b7e574f83 /test/echo-server.c | |
parent | df008ef97deacd5bb00ac335e5d8671798fa09dd (diff) |
2003-04-06 Havoc Pennington <hp@pobox.com>
* test/Makefile.am: remove a lot of stuff that isn't immediately
useful, it's in CVS history if we want it.
* test/test-service.c: use dbus-mainloop instead of that
watch.[hc] crack
Diffstat (limited to 'test/echo-server.c')
-rw-r--r-- | test/echo-server.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/test/echo-server.c b/test/echo-server.c deleted file mode 100644 index 9cfcd307..00000000 --- a/test/echo-server.c +++ /dev/null @@ -1,53 +0,0 @@ -#include <dbus/dbus.h> -#include <stdio.h> -#include "watch.h" - -static void -new_connection_callback (DBusServer *server, - DBusConnection *new_connection, - void *data) -{ - printf ("Got new connection\n"); - - dbus_connection_set_max_live_messages_size (new_connection, - 10); - - setup_connection (new_connection); -} - -int -main (int argc, - char **argv) -{ - DBusServer *server; - DBusError error; - - if (argc < 2) - { - fprintf (stderr, "Give the server address as an argument\n"); - return 1; - } - - dbus_error_init (&error); - server = dbus_server_listen (argv[1], &error); - if (server == NULL) - { - fprintf (stderr, "Failed to start server on %s: %s\n", - argv[1], error.message); - dbus_error_free (&error); - return 1; - } - - setup_server (server); - - dbus_server_set_new_connection_function (server, - new_connection_callback, - NULL, NULL); - - do_mainloop (); - - dbus_server_disconnect (server); - dbus_server_unref (server); - - return 0; -} |