Obsolete
/
libipc-old
Archived
3
0
Fork 0
pollfd
Karchnu 2020-07-04 11:45:09 +02:00
parent 1377e6fd28
commit e98b544539
1 changed files with 10 additions and 6 deletions

View File

@ -80,9 +80,6 @@ void main_loop ()
if (ret.error_code != IPC_ERROR_NONE) {
PRINTERR (ret, "server write");
}
if (verbosity > 1) {
printf ("message sent\n");
}
};
break;
case IPC_EVENT_TYPE_TIMER:{
@ -98,6 +95,13 @@ void main_loop ()
fprintf (stderr, ", %d ctx remaining\n", cpt);
};
break;
case IPC_EVENT_TYPE_TX:
{
if (verbosity > 1) {
printf ("a message was sent\n");
}
}
break;
default:
{
fprintf (stderr, "there must be a problem, event not set\n");
@ -132,15 +136,15 @@ void exit_program (int signal)
int main (int argc, char *argv[])
{
argc = argc; // warnings
argv = argv; // warnings
if (argc > 1) {
verbosity = atoi(argv[1]);
}
printf ("pid = %d\n", getpid ());
ctx = malloc (sizeof (struct ipc_ctx));
memset (ctx, 0, sizeof (struct ipc_ctx));
struct ipc_error ret = ipc_server_init (ctx, PONGD_SERVICE_NAME);
if (ret.error_code != IPC_ERROR_NONE) {
PRINTERR (ret, "server init");