summaryrefslogtreecommitdiffstats
path: root/test/echo-server.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-04-07 01:07:13 +0000
committerHavoc Pennington <hp@redhat.com>2003-04-07 01:07:13 +0000
commit98572905e60cac7ea971aa0830e2a629bfff208d (patch)
tree2e3ebcfe8670fc403ac4262c96fa714b7e574f83 /test/echo-server.c
parentdf008ef97deacd5bb00ac335e5d8671798fa09dd (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.c53
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;
-}