cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
websocket_async.h
Go to the documentation of this file.
1
11#ifndef __CWIST_WEBSOCKET_ASYNC_H__
12#define __CWIST_WEBSOCKET_ASYNC_H__
13
15#include <stddef.h>
16#include <stdint.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
23
33 void *user_data);
34
41typedef void (*cwist_ws_on_close_t)(cwist_websocket_async *ws, void *user_data);
42
58 const uint8_t *data, size_t len);
59
70
71#ifdef __cplusplus
72}
73#endif
74
75#endif
WebSocket upgrade and frame handling.
cwist_ws_opcode_t
Definition websocket.h:13
int cwist_websocket_async_send(cwist_websocket_async *ws, cwist_ws_opcode_t opcode, const uint8_t *data, size_t len)
Serialize and send one FIN-terminated frame without blocking.
struct cwist_websocket_async cwist_websocket_async
void cwist_websocket_async_close(cwist_websocket_async *ws)
Initiate the close handshake without blocking.
void(* cwist_ws_on_message_t)(cwist_websocket_async *ws, cwist_ws_frame *frame, void *user_data)
Callback invoked for each complete WebSocket message on the C1M path.
void(* cwist_ws_on_close_t)(cwist_websocket_async *ws, void *user_data)
Optional teardown hook for the callback-shaped WS path (see cwist_websocket_async_attach_ex in ws_asy...