|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
ascii-chat Client Main Entry Point More...
Go to the source code of this file.
Data Structures | |
| struct | client_session_state_t |
| Client connection session state for session_client_like integration. More... | |
Functions | |
| int | client_main (void) |
| Client mode entry point for unified binary. | |
Variables | |
| thread_pool_t * | g_client_worker_pool = NULL |
| Global client worker thread pool. | |
| app_client_t * | g_client = NULL |
| Global client application context. | |
| struct webrtc_peer_manager * | g_peer_manager = NULL |
| Global WebRTC peer manager (legacy compatibility) | |
ascii-chat Client Main Entry Point
This module serves as the main entry point for the ascii-chat client application. It orchestrates the entire client lifecycle including initialization, connection management, and the primary event loop that manages reconnection logic.
The client follows a modular threading architecture:
The client implements robust reconnection logic with exponential backoff:
Each connection cycle follows this pattern:
The main loop implements graceful error recovery:
Uses platform abstraction layer for:
Definition in file client/main.c.
| 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().
| app_client_t* g_client = NULL |
Global client application context.
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.
| thread_pool_t* g_client_worker_pool = NULL |
Global client worker thread pool.
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().
| struct webrtc_peer_manager* g_peer_manager = NULL |
Global WebRTC peer manager (legacy compatibility)
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.