bmsd/websocket.h

Thu, 01 Jul 2021 13:24:19 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 01 Jul 2021 13:24:19 +0200
changeset 765
0218893a5b7f
parent 671
4b54d6f79d25
permissions
-rw-r--r--

Added some tooltips to inventory yeasts. Added POF+ and STA1 columns to inventory yeasts list.

/**
 * @file websocket.h
 */

#ifndef _WEBSOCKET_H
#define	_WEBSOCKET_H


struct per_session_data__lws_mirror {
        struct lws *wsi;
        int ringbuffer_tail;
};

/**
 * @brief Broadcast messages to all connected websocket clients.
 * @param msg The message to send. Messages are placed in a ringbuffer queue.
 */
void ws_broadcast(char *msg);

/**
 * @brief Check if a connection is idle for 45 seconds and if so send a ping like
 *        message to keep the connection alive. Call this function at regular intervals.
 */
void ws_check(void);

/**
 * @brief The websockets server thread.
 */
void *ws_loop(void *);

#endif

mercurial