MQTT C Client Libraries Internals
|
A file system based persistence implementation. More...
#include "OsWrapper.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>
#include "MQTTClientPersistence.h"
#include "MQTTPersistenceDefault.h"
#include "StackTrace.h"
#include "Heap.h"
Functions | |
int | keysUnix (char *, char ***, int *) |
int | clearUnix (char *) |
int | containskeyUnix (char *, char *) |
int | pstopen (void **handle, const char *clientID, const char *serverURI, void *context) |
Create persistence directory for the client: context/clientID-serverURI. More... | |
int | pstmkdir (char *pPathname) |
Function to create a directory. More... | |
int | pstput (void *handle, char *key, int bufcount, char *buffers[], int buflens[]) |
Write wire message to the client persistence directory. More... | |
int | pstget (void *handle, char *key, char **buffer, int *buflen) |
Retrieve a wire message from the client persistence directory. More... | |
int | pstremove (void *handle, char *key) |
Delete a persisted message from the client persistence directory. More... | |
int | pstclose (void *handle) |
Delete client persistence directory (if empty). More... | |
int | pstcontainskey (void *handle, char *key) |
Returns whether if a wire message is persisted in the client persistence directory. More... | |
int | pstclear (void *handle) |
Delete all the persisted message in the client persistence directory. More... | |
int | pstkeys (void *handle, char ***keys, int *nkeys) |
Returns the keys (file names w/o the extension) in the client persistence directory. More... | |
A file system based persistence implementation.
A directory is specified when the MQTT client is created. When the persistence is then opened (see Persistence_open), a sub-directory is made beneath the base for this particular client ID and connection key. This allows one persistence base directory to be shared by multiple clients.
int pstclear | ( | void * | handle | ) |
Delete all the persisted message in the client persistence directory.
int pstclose | ( | void * | handle | ) |
Delete client persistence directory (if empty).
int pstcontainskey | ( | void * | handle, |
char * | key | ||
) |
Returns whether if a wire message is persisted in the client persistence directory.
int pstget | ( | void * | handle, |
char * | key, | ||
char ** | buffer, | ||
int * | buflen | ||
) |
Retrieve a wire message from the client persistence directory.
See Persistence_get
int pstkeys | ( | void * | handle, |
char *** | keys, | ||
int * | nkeys | ||
) |
Returns the keys (file names w/o the extension) in the client persistence directory.
See Persistence_keys
int pstmkdir | ( | char * | pPathname | ) |
Function to create a directory.
Returns 0 on success or if the directory already exists.
int pstopen | ( | void ** | handle, |
const char * | clientID, | ||
const char * | serverURI, | ||
void * | context | ||
) |
Create persistence directory for the client: context/clientID-serverURI.
See Persistence_open
int pstput | ( | void * | handle, |
char * | key, | ||
int | bufcount, | ||
char * | buffers[], | ||
int | buflens[] | ||
) |
Write wire message to the client persistence directory.
See Persistence_put
int pstremove | ( | void * | handle, |
char * | key | ||
) |
Delete a persisted message from the client persistence directory.