|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
ascii-chat Client Mode Entry Point Header More...
Go to the source code of this file.
Functions | |
| int | client_main (void) |
| Client mode entry point for unified binary. | |
Variables | |
| crypto_handshake_context_t | g_crypto_ctx |
| Global crypto handshake context for this client connection. | |
| thread_pool_t * | g_client_worker_pool |
| Global client worker thread pool. | |
| app_client_t * | g_client |
| Global client application context. | |
| struct webrtc_peer_manager * | g_peer_manager |
| Global WebRTC peer manager for P2P connections. | |
ascii-chat Client Mode Entry Point Header
This header exposes the client mode entry point for the unified binary architecture. The unified binary dispatches to client_main() when invoked as ascii-chat client.
The ascii-chat application uses a single binary with multiple operating modes:
This design provides several benefits:
Each mode entry point (server_main, client_main) must:
int mode_main(void)The client_main() function is the original main() from src/client/main.c, adapted to the new dispatcher pattern. Common initialization (options parsing, logging setup, lock debugging, –show-capabilities) now happens in src/main.c before dispatch.
Definition in file client/main.h.
| int client_main | ( | void | ) |
Client mode entry point for unified binary.
This function implements the complete client lifecycle including:
Options are already parsed by the main dispatcher before this function is called, so they are available via global opt_* variables.
Definition at line 569 of file client/main.c.
References asciichat_shared_destroy(), connection_context_cleanup(), connection_context_init(), client_session_state_t::connection_ctx, client_session_state_t::discovered_address, client_session_state_t::discovered_port, discovery_tui_free_results(), discovery_tui_get_best_address(), discovery_tui_query(), discovery_tui_select(), is_localhost_ipv4(), log_lock_terminal(), options_get(), options_set_bool(), server_connection_shutdown(), session_client_like_run(), session_log_buffer_destroy(), set_interrupt_callback(), url_is_websocket(), and webcam_print_init_error_help().
|
extern |
Global client application context.
Central state management structure for the client, containing both network and application-layer state.
This instance provides:
Initialized by app_client_create() in client_main(). Destroyed by app_client_destroy() at cleanup.
All client modules (protocol.c, audio.c, capture.c, display.c) should use this instance instead of accessing global connection state.
Global application client context
Central connection and application state for the client. Contains transport-agnostic state: audio, threads, display, crypto. Network-specific state (socket, connection flags) is in the active transport client.
Initialized by app_client_create() in client_main(). Destroyed by app_client_destroy() at cleanup.
Definition at line 151 of file client/main.c.
|
extern |
Global client worker thread pool.
Manages all client worker threads including:
This pool is initialized in client_main() and accessible from all client modules for spawning and managing worker threads.
Global client worker thread pool
Manages all client worker threads including:
Definition at line 139 of file client/main.c.
Referenced by audio_start_thread(), capture_start_thread(), keepalive_start_thread(), protocol_start_connection(), and protocol_stop_connection().
|
extern |
Global WebRTC peer manager for P2P connections.
Manages WebRTC peer connections for ACDS session participants. Handles SDP/ICE exchange and DataChannel lifecycle for P2P ACIP transport.
NULL if WebRTC not initialized (TCP-only mode). Initialized when joining/creating ACDS sessions with WebRTC transport.
Global WebRTC peer manager for P2P connections.
Client mode no longer uses WebRTC, but protocol.c still references this. Always NULL in client mode.
Definition at line 159 of file client/main.c.