26 lines
700 B
C
26 lines
700 B
C
#ifndef CHAT_H
|
|
#define CHAT_H
|
|
|
|
#include <libwebsockets.h>
|
|
|
|
/**
|
|
* cb_chat - libwebsockets protocol callback for COMS chat.
|
|
*
|
|
* This function is registered in the protocols array passed to the
|
|
* lws_context and handles connection, receive, writable, and close events.
|
|
*
|
|
* @wsi: The WebSocket instance pointer
|
|
* @reason: One of the LWS_CALLBACK_* reasons
|
|
* @user: Pointer to a session_t* for this connection
|
|
* @in: Pointer to incoming data (for receive events)
|
|
* @len: Length of the incoming data buffer
|
|
*
|
|
* Return: 0 on success, non-zero on error.
|
|
*/
|
|
int cb_chat(
|
|
struct lws* wsi, enum lws_callback_reasons reason, void* user, void* in,
|
|
size_t len
|
|
);
|
|
|
|
#endif // CHAT_H
|