ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
include/ascii-chat/network/websocket/server.h
Go to the documentation of this file.
1#pragma once
2
52#include <stdint.h>
53#include <stdbool.h>
54#include <ascii-chat/atomic.h>
55#include "../../common.h"
56#include "../../platform/abstraction.h"
57#include "../../thread_pool.h"
58#include <libwebsockets.h>
59
60// Forward declarations
64
74typedef void *(*websocket_client_handler_fn)(void *arg);
75
89
100
112
123
133
140
⚛️ Atomic operations abstraction layer with debug tracking
asciichat_error_t
Error and exit codes - unified status values (0-255)
Definition error_codes.h:49
asciichat_error_t websocket_server_init(websocket_server_t *server, const websocket_server_config_t *config)
Initialize WebSocket server.
asciichat_error_t websocket_server_run(websocket_server_t *server)
Run WebSocket server event loop.
void websocket_server_destroy(websocket_server_t *server)
Destroy WebSocket server and free resources.
void *(* websocket_client_handler_fn)(void *arg)
Client handler function type.
void websocket_server_cancel_service(websocket_server_t *server)
Wake the WebSocket server event loop immediately.
ClangTool/LibTooling compatibility shim for stdbool.h.
Transport instance structure.
Definition transport.h:214
Atomic value wrapper for integral/boolean types.
Definition atomic.h:76
Thread pool structure.
Context passed to client handler thread.
acip_transport_t * transport
ACIP transport for this client.
bool auth_required
True if client authentication is required.
void * user_data
User-provided data from server config.
bool is_secure
True if connection is using TLS (wss://)
websocket_client_handler_fn client_handler
Handler for new connections.
void * user_data
User data passed to handlers.
const char * tls_cert_path
TLS certificate file path (optional, for wss://)
const char * tls_key_path
TLS private key file path (optional, for wss://)
websocket_client_handler_fn handler
Client handler function.
struct thread_pool * handler_pool
Thread pool for queueing handler work.
struct lws_context * context
libwebsockets context
void thread_pool_t