Obsolete
/
libipc-old
Archived
3
0
Fork 0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
libipc-old/tests/func_01_connection_establis...

38 lines
866 B
C
Raw Normal View History

2019-07-27 15:48:56 +02:00
#include "../src/ipc.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SERVICE_NAME "pong"
2020-06-29 16:49:54 +02:00
int main(int argc, char * argv[])
2019-07-27 15:48:56 +02:00
{
argc = (int) argc;
argv = (char **) argv;
SECURE_DECLARATION(struct ipc_error, ret);
2020-06-29 16:49:54 +02:00
SECURE_DECLARATION(struct ipc_ctx, ctx);
2019-07-27 15:48:56 +02:00
SECURE_DECLARATION(struct ipc_event, event);
2020-06-29 16:49:54 +02:00
ret = ipc_connection (&ctx, SERVICE_NAME);
if (ret.error_code != IPC_ERROR_NONE) {
2020-06-29 16:49:54 +02:00
printf ("error: %s\n", ipc_errors_get(ret.error_code));
2019-07-27 15:48:56 +02:00
return EXIT_FAILURE;
}
2020-06-29 16:49:54 +02:00
// int timer = 10000; // 10 seconds
// ret = ipc_wait_event (services, struct ipc_event *event, &timer);
// if (ret.error_code != IPC_ERROR_NONE) {
2019-07-27 15:48:56 +02:00
// return EXIT_FAILURE;
// }
2020-06-29 16:49:54 +02:00
ret = ipc_close_all (&ctx);
if (ret.error_code != IPC_ERROR_NONE) {
2020-06-29 16:49:54 +02:00
printf ("error: %s\n", ipc_errors_get(ret.error_code));
2019-07-27 15:48:56 +02:00
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}