Files
cosmopolite/clients/c/test.c

17 lines
428 B
C
Raw Normal View History

2015-06-02 22:21:28 -07:00
#include <unistd.h>
2015-06-06 10:44:46 -07:00
#include "cosmopolite.h"
2015-06-02 22:21:28 -07:00
int main(int argc, char *argv[]) {
2015-06-03 22:45:07 -07:00
char client_id[COSMO_UUID_SIZE];
cosmo_generate_uuid(client_id);
2015-06-06 10:39:33 -07:00
cosmo *instance = cosmo_create("https://playground.cosmopolite.org/cosmopolite", client_id);
2015-06-03 22:24:07 -07:00
json_t *subject = cosmo_subject("foobar", NULL, NULL);
cosmo_subscribe(instance, subject, -1, 0);
json_decref(subject);
2015-06-05 23:20:07 -07:00
sleep(120);
2015-06-02 22:21:28 -07:00
cosmo_destroy(instance);
return 0;
}