4#ifndef __CWIST_WEBSOCKET_H__
5#define __CWIST_WEBSOCKET_H__
struct cwist_websocket cwist_websocket
struct cwist_ws_frame cwist_ws_frame
cwist_websocket * cwist_websocket_upgrade(cwist_http_request *req, int client_fd)
Upgrade a standard HTTP request to a WebSocket connection.
cwist_ws_frame * cwist_websocket_receive(cwist_websocket *ws)
Receive a frame, blocking until data arrives or the socket closes.
@ CWIST_WS_FRAME_CONTINUATION
void cwist_websocket_close(cwist_websocket *ws)
Close the WebSocket connection.
int cwist_websocket_send(cwist_websocket *ws, cwist_ws_opcode_t opcode, const uint8_t *data, size_t len)
Send a frame with the specified opcode and payload.
void cwist_websocket_frame_destroy(cwist_ws_frame *frame)
Destroy a frame.
void cwist_websocket_destroy(cwist_websocket *ws)
Destroy the WebSocket context.