Webcom C SDK
|
int64_t | wc_datasync_server_time (wc_context_t *cnx) |
void | wc_datasync_gen_push_id (wc_context_t *cnx, char *result) |
const char * | wc_version () |
void wc_datasync_gen_push_id | ( | wc_context_t * | cnx, |
char * | result | ||
) |
builds a webcom push id
This function will write a new push id in the buffer pointed by result
.
A push id is a 20-bytes string that guarantees several properties:
Example:
foo(wc_cnx_t *cnx) { char buf[20]; ... wc_get_push_id(cnx, buf); printf("the id is: %20s\n", buf); ... }
cnx | the webcom connection (it MUST have received the handshake from the server, and it may be currently connected or disconnected) |
result | the address of a (minimum) 20-bytes buffer that will receive the newly created push id |
int64_t wc_datasync_server_time | ( | wc_context_t * | cnx | ) |
gets the server time in milliseconds since 1970/1/1
This function returns the (estimated) time on the server, in milliseconds. It is achieved by the SDK by computing and memorizing the clock offset between the local machine and the server when establishing the connection to the Webcom server.
cnx | the webcom connection |
const char* wc_version | ( | ) |
get the webcom SDK version string