ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
include/ascii-chat/network/websocket/client.h
Go to the documentation of this file.
1
63#ifndef NETWORK_WEBSOCKET_CLIENT_H
64#define NETWORK_WEBSOCKET_CLIENT_H
65
66#include <ascii-chat/atomic.h>
67#include <stdbool.h>
68#include <stdint.h>
69
70#include "../../common.h"
71#include "../../asciichat_errno.h"
72#include "../acip/transport.h"
73#include "../packet/packet.h"
74#include "../../platform/abstraction.h"
75
76/* Forward declarations */
77struct crypto_context_t;
78
123
137
149
157
165
173
180
187
194
202
209
216
223
230
246 struct crypto_context_t *crypto_ctx);
247
255
271int websocket_client_send_packet(websocket_client_t *client, packet_type_t type, const void *data, size_t len);
272
284
296
306
314
315#endif /* NETWORK_WEBSOCKET_CLIENT_H */
⚛️ Atomic operations abstraction layer with debug tracking
unsigned int uint32_t
Definition common.h:58
packet_type_t
Network protocol packet type enumeration.
Definition packet.h:286
int websocket_client_send_pong(websocket_client_t *client)
Send pong frame (keepalive response)
void websocket_client_enable_encryption(websocket_client_t *client)
Enable encryption for this connection.
int websocket_client_send_packet(websocket_client_t *client, packet_type_t type, const void *data, size_t len)
Send a packet through WebSocket connection (thread-safe)
bool websocket_client_is_active(const websocket_client_t *client)
Check if connection is currently active.
void websocket_client_shutdown(websocket_client_t *client)
Shutdown connection forcefully (for signal handlers)
uint32_t websocket_client_get_id(const websocket_client_t *client)
Get the client's unique ID.
acip_transport_t * websocket_client_connect(websocket_client_t *client, const char *url, struct crypto_context_t *crypto_ctx)
Establish WebSocket connection to server.
websocket_client_t * websocket_client_create(const char *name)
Create and initialize a named WebSocket client instance.
bool websocket_client_is_lost(const websocket_client_t *client)
Check if connection was lost.
void websocket_client_disable_encryption(websocket_client_t *client)
Disable encryption for this connection.
struct websocket_client websocket_client_t
WebSocket client connection state.
void websocket_client_close(websocket_client_t *client)
Close connection gracefully.
void websocket_client_destroy(websocket_client_t **client_ptr)
Destroy WebSocket client and free all resources.
void websocket_client_clear_reconnect_flag(websocket_client_t *client)
Clear reconnection flag (called after successful reconnect)
acip_transport_t * websocket_client_get_transport(const websocket_client_t *client)
Get active transport instance.
void websocket_client_signal_reconnect(websocket_client_t *client)
Signal that reconnection should be attempted.
bool websocket_client_is_encryption_enabled(const websocket_client_t *client)
Check if encryption is enabled.
bool websocket_client_is_encrypted(const websocket_client_t *client)
Check if encryption is enabled for this connection.
void websocket_client_signal_lost(websocket_client_t *client)
Signal that connection was lost (triggers reconnection)
int websocket_client_send_ping(websocket_client_t *client)
Send ping frame (keepalive heartbeat)
bool websocket_client_should_reconnect(const websocket_client_t *client)
Check if reconnection should be attempted.
struct websocket_client_t websocket_client_t
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
Cryptographic context structure.
Mutex type (POSIX: pthread_mutex_t with debug tracking)
WebSocket client connection state.