ymo_mqtt_session.h¶
-
type ymo_mqtt_session_t¶
Internal structure used to manage a yimmo mqtt session.
typedef struct ymo_mqtt_session { /** TODO: can we get rid of embedding the conn in the session? */ ymo_conn_t* conn; ymo_mqtt_msg_t msg_in; ymo_mqtt_state_t state; ymo_bucket_t* send_head; ymo_bucket_t* send_tail; char client_id[24]; uint16_t ka_timer; uint8_t connect_flags; ymo_mqtt_str_t username; ymo_mqtt_str_t password; ymo_mqtt_str_t will_topic; ymo_mqtt_str_t will_msg; ymo_mqtt_proto_version_t proto_id; } ymo_mqtt_session_t;
-
ymo_mqtt_session_t *ymo_mqtt_session_create(ymo_conn_t *conn)¶
Create a new MQTT session.
-
void ymo_mqtt_session_msg_free(ymo_mqtt_session_t *session)¶
Clear and deallocate memory associated with the variable header and payload sections of the incoming message structure on the given session.
-
void ymo_mqtt_session_free(ymo_mqtt_session_t *session)¶
Clear and free the given mqtt session object, including any nested data which has been dynamically allocated.