|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
ACIP protocol packet handlers implementation. More...
Go to the source code of this file.
Data Structures | |
| struct | handler_hash_entry_t |
| Hash table entry for packet type to handler mapping. More... | |
Macros | |
| #define | HANDLER_HASH_SIZE 32 |
| #define | CLIENT_HANDLER_COUNT 19 |
| #define | SERVER_HANDLER_COUNT 19 |
| #define | HANDLER_HASH(type) ((type) % HANDLER_HASH_SIZE) |
Typedefs | |
| typedef asciichat_error_t(* | acip_client_handler_func_t) (const void *payload, size_t payload_len, const acip_client_callbacks_t *callbacks) |
| typedef asciichat_error_t(* | acip_server_handler_func_t) (const void *payload, size_t payload_len, void *client_ctx, const acip_server_callbacks_t *callbacks) |
Functions | |
| asciichat_error_t | acip_handle_client_packet (acip_transport_t *transport, packet_type_t type, const void *payload, size_t payload_len, const acip_client_callbacks_t *callbacks) |
| asciichat_error_t | acip_handle_server_packet (acip_transport_t *transport, packet_type_t type, const void *payload, size_t payload_len, void *client_ctx, const acip_server_callbacks_t *callbacks) |
ACIP protocol packet handlers implementation.
Implements packet dispatching for both client and server sides. Uses O(1) array-based dispatch instead of O(n) switch statements. Parses packet payloads and dispatches to registered callbacks.
Definition in file network/acip/handlers.c.
| #define CLIENT_HANDLER_COUNT 19 |
Definition at line 42 of file network/acip/handlers.c.
| #define HANDLER_HASH | ( | type | ) | ((type) % HANDLER_HASH_SIZE) |
Definition at line 54 of file network/acip/handlers.c.
| #define HANDLER_HASH_SIZE 32 |
Definition at line 41 of file network/acip/handlers.c.
| #define SERVER_HANDLER_COUNT 19 |
Definition at line 43 of file network/acip/handlers.c.
| typedef asciichat_error_t(* acip_client_handler_func_t) (const void *payload, size_t payload_len, const acip_client_callbacks_t *callbacks) |
Definition at line 29 of file network/acip/handlers.c.
| typedef asciichat_error_t(* acip_server_handler_func_t) (const void *payload, size_t payload_len, void *client_ctx, const acip_server_callbacks_t *callbacks) |
Definition at line 32 of file network/acip/handlers.c.
| asciichat_error_t acip_handle_client_packet | ( | acip_transport_t * | transport, |
| packet_type_t | type, | ||
| const void * | payload, | ||
| size_t | payload_len, | ||
| const acip_client_callbacks_t * | callbacks | ||
| ) |
Definition at line 195 of file network/acip/handlers.c.
Referenced by acip_client_receive_and_dispatch().
| asciichat_error_t acip_handle_server_packet | ( | acip_transport_t * | transport, |
| packet_type_t | type, | ||
| const void * | payload, | ||
| size_t | payload_len, | ||
| void * | client_ctx, | ||
| const acip_server_callbacks_t * | callbacks | ||
| ) |
Definition at line 635 of file network/acip/handlers.c.
Referenced by acip_server_receive_and_dispatch(), and client_dispatch_thread().