Client API and messaging

RimStone provides SEMI messaging API for a C client (see Client-API). It means you can read sets of key/value pairs sent by the server, and also create sets of key/value pairs and send them to the server (or read to/write from a file etc.).

This API is binary-compatible with new-message, write-message, read-message etc.

The following C API is provided:
Examples
Here's the sample code illustrating use of the API:
#include "rcli.h" // include C API header file

...

rim_msg *msg; // message type variable

// Create new message
msg = rim_new_msg (NULL, 0);

...

// Write key/value (assuming value is a zero-bound string)
char key[100], value[100];
strcpy (key, "some key");
strcpy (value, "some key");
rim_write_msg (msg, key, value, strlen(value));

...

// Read key/value from the message
char *k, *v;
rim_num len;
rim_read_msg (msg, &k, &v, &len);

...

// Free the message data
free (rim_get_msg(msg));
// Free the message
free (msg);

See also
API
Client-API  
Client-API-and-messaging  
Server-API  
See all
documentation


Copyright (c) 2019-2025 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.