--- mqtt/inc/mqttd.h 2012/04/11 15:08:26 1.2.2.3 +++ mqtt/inc/mqttd.h 2012/06/26 08:05:58 1.2.2.13 @@ -2,19 +2,19 @@ #define __MQTTD_H +#define API_SERVER_SIDE +#include + + struct tagStore { - char st_qos; u_short st_msgid; mqtt_subscr_t st_subscr; - TAILQ_ENTRY(tagStore) st_node; + SLIST_ENTRY(tagStore) st_node; }; struct tagSession { - /* client session thread id */ - pthread_t sess_tid; - pthread_mutex_t sess_mtx; /* server dispatcher */ mqtt_srv_t *sess_srv; @@ -42,8 +42,8 @@ struct tagSession { char *msg; } sess_will; - /* Data Storage by QoS class */ - TAILQ_HEAD(qosStore, tagStore) sess_sndqueue; + /* session subscriptions & send pubs */ + SLIST_HEAD(tStore, tagStore) sess_subscr; TAILQ_ENTRY(tagSession) sess_node; }; @@ -53,7 +53,10 @@ typedef TAILQ_HEAD(, tagSession) sessions_t; extern sessions_t Sessions; extern sched_root_task_t *root; extern cfg_root_t cfg; -extern pthread_mutex_t mtx_sess, mtx_pub; + + +/* function prototypes */ +void *startSession(sched_task_t *task); #endif