|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
📡 Client-side packet processing and data reception thread More...
Files | |
| file | protocol.c |
| 📡 Client protocol handler: packet reception, parsing, and dispatch with data thread coordination | |
| file | protocol.h |
| ascii-chat Client Protocol Handler Interface | |
Data Structures | |
| struct | remote_client_info_t |
| Remote client information structure for multi-user client tracking. More... | |
Functions | |
| int | protocol_start_connection () |
| Start protocol connection handling. | |
| void | protocol_stop_connection () |
| Stop protocol connection handling. | |
| bool | protocol_connection_lost () |
| Check if connection has been lost. | |
| const acip_client_callbacks_t * | protocol_get_acip_callbacks () |
| Get ACIP client callbacks for packet dispatch. | |
📡 Client-side packet processing and data reception thread
The protocol handler manages the data reception thread, processes incoming packets from the server, and dispatches them to appropriate handlers based on packet type.
Implementation: src/client/protocol.c, src/client/protocol.h
Loss triggers in protocol thread:
receive_packet() returns error| bool protocol_connection_lost | ( | ) |
#include <protocol.c>
Check if connection has been lost.
Check if connection has been lost
Definition at line 1118 of file client/protocol.c.
References server_connection_is_lost().
| const acip_client_callbacks_t * protocol_get_acip_callbacks | ( | ) |
#include <protocol.h>
Get ACIP client callbacks for packet dispatch.
Used by WebRTC sessions to receive and dispatch ACDS signaling packets.
Returns pointer to the global callback structure for use by WebRTC sessions that need to receive ACDS signaling packets.
Definition at line 880 of file client/protocol.c.
| int protocol_start_connection | ( | ) |
#include <protocol.c>
Start protocol connection handling.
Start protocol connection handling
Initializes protocol state and starts the data reception thread. Must be called after successful server connection establishment.
Definition at line 985 of file client/protocol.c.
References audio_start_thread(), capture_start_thread(), display_reset_for_new_connection(), g_client_worker_pool, keepalive_start_thread(), thread_pool_spawn(), threaded_send_stream_start_packet(), and threaded_send_terminal_size_with_auto_detect().
| void protocol_stop_connection | ( | ) |
#include <protocol.c>
Stop protocol connection handling.
Stop protocol connection handling
Gracefully shuts down the data reception thread and cleans up protocol state. Safe to call multiple times.
Definition at line 1063 of file client/protocol.c.
References audio_stop_thread(), capture_stop_thread(), g_client_worker_pool, keepalive_stop_thread(), platform_sleep_us(), server_connection_shutdown(), and thread_pool_stop_all().