summaryrefslogtreecommitdiff
path: root/src/tools/echo/echo.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2016-06-14 14:55:39 +0200
committerSander Vrijders <[email protected]>2016-06-14 14:55:39 +0200
commit6271d09bdd17114c3095b7e819a7bcded14f26a5 (patch)
treea1c2a7bd200eb0343557524ddc80b0af6df4ec9e /src/tools/echo/echo.c
parentddfc7091d2698d36c1cfec49eaaad96b278bb37b (diff)
parent95124310f647913a678060fc10155a0ad9311dba (diff)
downloadouroboros-6271d09bdd17114c3095b7e819a7bcded14f26a5.tar.gz
ouroboros-6271d09bdd17114c3095b7e819a7bcded14f26a5.zip
Merged in dstaesse/ouroboros/be-api (pull request #122)
lib, irmd, tools, ipcpd: updates to dev API.
Diffstat (limited to 'src/tools/echo/echo.c')
-rw-r--r--src/tools/echo/echo.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/tools/echo/echo.c b/src/tools/echo/echo.c
index 849c0ca8..4484dc71 100644
--- a/src/tools/echo/echo.c
+++ b/src/tools/echo/echo.c
@@ -23,7 +23,6 @@
#include <stdio.h>
#include <string.h>
-#define SERVER_AP_NAME "echo-server"
#define BUF_SIZE 256
#include "echo_client.c"
@@ -37,14 +36,22 @@ static void usage()
" --help Display this help text and exit\n");
}
-int main(int argc, char ** argv) {
+int main(int argc, char ** argv)
+{
+ int ret = -1;
+ if (ap_init(argv[0])) {
+ printf("Failed to init AP.\n");
+ return -1;
+ }
argc--;
argv++;
while (argc > 0) {
if (strcmp(*argv, "-l") == 0 ||
strcmp(*argv, "--listen") == 0) {
- return server_main();
+ ret = server_main();
+ ap_fini();
+ return ret;
} else {
usage();
return 0;
@@ -53,5 +60,9 @@ int main(int argc, char ** argv) {
argv++;
}
- return client_main();
+ ret = client_main();
+
+ ap_fini();
+
+ return ret;
}