Add cosmo_send_message()

This commit is contained in:
Ian Gulliver
2015-06-06 14:56:23 -07:00
parent 6fd030e0bc
commit b66b7cc083
3 changed files with 16 additions and 0 deletions

View File

@@ -8,6 +8,9 @@ int main(int argc, char *argv[]) {
cosmo *instance = cosmo_create("https://playground.cosmopolite.org/cosmopolite", client_id);
json_t *subject = cosmo_subject("foobar", NULL, NULL);
cosmo_subscribe(instance, subject, -1, 0);
json_t *message = json_string("test from C");
cosmo_send_message(instance, subject, message);
json_decref(message);
json_decref(subject);
sleep(120);
cosmo_destroy(instance);