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/drop/print-bytes.c

28 lines
496 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include "../src/ipc.h"
int main(int argc, char * argv[])
{
SECURE_BUFFER_DECLARATION (char, buffer, 4096);
uint32_t msize = 0;
char *message = "coucou";
if (argc == 2) {
message = argv[1];
}
msize = ipc_message_raw_serialize (buffer, 2, 42, message, strlen(message));
write (1, buffer, msize);
fflush (stdout);
// to wait for a response
sleep (1);
return EXIT_SUCCESS;
}