|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
🏠 Server-side session hosting implementation More...
Go to the source code of this file.
Data Structures | |
| struct | session_host_client_t |
| Internal client record structure. More... | |
| struct | session_host |
| Internal session host structure. More... | |
Macros | |
| #define | SESSION_HOST_DEFAULT_MAX_CLIENTS 32 |
| Default maximum clients. | |
Typedefs | |
| typedef struct session_host | session_host_t |
| Internal session host structure. | |
🏠 Server-side session hosting implementation
Implements the session host abstraction for server-side client management and session coordination.
NOTE: This is a stub implementation that provides the API structure. Full implementation will integrate with existing server code in a future phase.
Definition in file host.c.
| #define SESSION_HOST_DEFAULT_MAX_CLIENTS 32 |
| typedef struct session_host session_host_t |
Internal session host structure.
Contains server state, client list, and callback configuration.
| uint32_t session_host_add_client | ( | session_host_t * | host, |
| socket_t | socket, | ||
| const char * | ip, | ||
| int | port | ||
| ) |
Definition at line 928 of file host.c.
References session_host_client_t::active, session_host_client_t::audio_active, session_host::callbacks, session_host::client_count, session_host_client_t::client_id, session_host::clients, session_host::clients_mutex, session_host_client_t::connected_at, image_destroy(), image_new(), session_host_client_t::incoming_audio, session_host_client_t::incoming_video, session_host::initialized, session_host_client_t::ip_address, session_host::max_clients, session_host::next_client_id, session_host_client_t::participant_type, session_host_client_t::port, ringbuffer_create(), ringbuffer_destroy(), session_host_client_t::socket, session_host_client_t::transport, session_host::user_data, and session_host_client_t::video_active.
Referenced by add_client(), and add_webrtc_client().
| uint32_t session_host_add_memory_participant | ( | session_host_t * | host | ) |
Definition at line 996 of file host.c.
References session_host_client_t::active, session_host_client_t::audio_active, session_host::callbacks, session_host::client_count, session_host_client_t::client_id, session_host::clients, session_host::clients_mutex, session_host_client_t::connected_at, image_destroy(), image_new(), session_host_client_t::incoming_audio, session_host_client_t::incoming_video, session_host::initialized, session_host_client_t::ip_address, session_host::max_clients, session_host::next_client_id, participant_id, session_host_client_t::participant_type, session_host_client_t::port, ringbuffer_create(), ringbuffer_destroy(), session_host_client_t::socket, session_host_client_t::transport, session_host::user_data, and session_host_client_t::video_active.
| asciichat_error_t session_host_broadcast_frame | ( | session_host_t * | host, |
| const char * | frame | ||
| ) |
Definition at line 1258 of file host.c.
References session_host_client_t::active, session_host_client_t::client_id, session_host::clients, session_host::clients_mutex, session_host::initialized, session_host::max_clients, packet_send(), session_host::running, and session_host_client_t::socket.
| bool session_host_client_has_transport | ( | session_host_t * | host, |
| uint32_t | client_id | ||
| ) |
Definition at line 1461 of file host.c.
References session_host_client_t::active, session_host_client_t::client_id, session_host::clients, session_host::clients_mutex, session_host::initialized, session_host::max_clients, and session_host_client_t::transport.
| session_host_t * session_host_create | ( | const session_host_config_t * | config | ) |
Definition at line 166 of file host.c.
References session_host::callbacks, session_host::client_count, session_host::clients, session_host::clients_mutex, session_host::encryption_enabled, session_host::initialized, session_host::ipv4_address, session_host::ipv6_address, session_host::key_path, session_host::max_clients, mutex_init(), session_host::next_client_id, session_host::password, session_host::port, session_host::running, SESSION_HOST_DEFAULT_MAX_CLIENTS, session_host::socket_v4, session_host::socket_v6, and session_host::user_data.
Referenced by discovery_session_become_host(), discovery_session_process(), and server_main().
| void session_host_destroy | ( | session_host_t * | host | ) |
Definition at line 222 of file host.c.
References session_host::audio_ctx, session_host::clients, session_host::clients_mutex, image_destroy(), session_host_client_t::incoming_audio, session_host_client_t::incoming_video, session_host::initialized, session_host::max_clients, mutex_destroy(), opus_codec_destroy(), session_host::opus_decoder, session_host::password, ringbuffer_destroy(), session_host::running, session_audio_destroy(), session_host_stop(), session_host::socket_v4, and session_host::socket_v6.
Referenced by discovery_session_destroy(), and server_main().
| asciichat_error_t session_host_find_client | ( | session_host_t * | host, |
| uint32_t | client_id, | ||
| session_host_client_info_t * | info | ||
| ) |
Definition at line 1204 of file host.c.
References session_host_client_t::active, session_host_client_t::audio_active, session_host_client_t::client_id, session_host::clients, session_host::clients_mutex, session_host_client_t::connected_at, session_host::initialized, session_host_client_t::ip_address, session_host::max_clients, session_host_client_t::port, and session_host_client_t::video_active.
| int session_host_get_client_count | ( | session_host_t * | host | ) |
Definition at line 1229 of file host.c.
References session_host::client_count, and session_host::initialized.
| int session_host_get_client_ids | ( | session_host_t * | host, |
| uint32_t * | ids, | ||
| int | max_ids | ||
| ) |
Definition at line 1236 of file host.c.
References session_host_client_t::active, session_host_client_t::client_id, session_host::clients, session_host::clients_mutex, session_host::initialized, and session_host::max_clients.
| acip_transport_t * session_host_get_client_transport | ( | session_host_t * | host, |
| uint32_t | client_id | ||
| ) |
Definition at line 1441 of file host.c.
References session_host_client_t::active, session_host_client_t::client_id, session_host::clients, session_host::clients_mutex, session_host::initialized, session_host::max_clients, and session_host_client_t::transport.
| asciichat_error_t session_host_inject_audio | ( | session_host_t * | host, |
| uint32_t | participant_id, | ||
| const float * | samples, | ||
| size_t | count | ||
| ) |
Definition at line 1117 of file host.c.
References session_host_client_t::active, session_host_client_t::audio_active, session_host_client_t::client_id, session_host::clients, session_host::clients_mutex, session_host_client_t::incoming_audio, session_host::initialized, session_host::max_clients, participant_id, session_host_client_t::participant_type, and ringbuffer_write().
| asciichat_error_t session_host_inject_frame | ( | session_host_t * | host, |
| uint32_t | participant_id, | ||
| const image_t * | frame | ||
| ) |
Definition at line 1072 of file host.c.
References session_host_client_t::active, session_host_client_t::client_id, session_host::clients, session_host::clients_mutex, image_destroy(), image_new(), session_host_client_t::incoming_video, session_host::initialized, session_host::max_clients, participant_id, session_host_client_t::participant_type, and session_host_client_t::video_active.
| bool session_host_is_running | ( | session_host_t * | host | ) |
Definition at line 917 of file host.c.
References session_host::initialized, and session_host::running.
| asciichat_error_t session_host_remove_client | ( | session_host_t * | host, |
| uint32_t | client_id | ||
| ) |
Definition at line 1160 of file host.c.
References session_host_client_t::active, session_host::callbacks, session_host::client_count, session_host_client_t::client_id, session_host::clients, session_host::clients_mutex, image_destroy(), session_host_client_t::incoming_audio, session_host_client_t::incoming_video, session_host::initialized, session_host::max_clients, ringbuffer_destroy(), session_host_client_t::socket, and session_host::user_data.
Referenced by remove_client().
| asciichat_error_t session_host_send_frame | ( | session_host_t * | host, |
| uint32_t | client_id, | ||
| const char * | frame | ||
| ) |
Definition at line 1287 of file host.c.
References session_host_client_t::active, session_host_client_t::client_id, session_host::clients, session_host::clients_mutex, session_host::initialized, session_host::max_clients, packet_send(), session_host::running, and session_host_client_t::socket.
| asciichat_error_t session_host_set_client_transport | ( | session_host_t * | host, |
| uint32_t | client_id, | ||
| acip_transport_t * | transport | ||
| ) |
Definition at line 1409 of file host.c.
References session_host_client_t::active, session_host_client_t::client_id, session_host::clients, session_host::clients_mutex, session_host::initialized, session_host::max_clients, and session_host_client_t::transport.
| asciichat_error_t session_host_start | ( | session_host_t * | host | ) |
Definition at line 797 of file host.c.
References session_host::accept_thread, session_host::accept_thread_running, asciichat_thread_create(), asciichat_thread_join(), session_host::callbacks, session_host::initialized, session_host::ipv4_address, session_host::port, session_host::receive_thread, session_host::receive_thread_running, session_host::running, session_host::socket_v4, and session_host::user_data.
Referenced by discovery_session_become_host(), and discovery_session_process().
| asciichat_error_t session_host_start_render | ( | session_host_t * | host | ) |
Definition at line 1318 of file host.c.
References asciichat_thread_create(), session_host::audio_ctx, session_host::initialized, opus_codec_create_decoder(), opus_codec_create_encoder(), opus_codec_destroy(), session_host::opus_decoder, session_host::opus_encoder, session_host::render_thread, session_host::render_thread_running, session_host::running, session_audio_create(), and session_audio_destroy().
| void session_host_stop | ( | session_host_t * | host | ) |
Definition at line 857 of file host.c.
References session_host::accept_thread, session_host::accept_thread_running, session_host_client_t::active, asciichat_thread_join(), session_host::callbacks, session_host::client_count, session_host_client_t::client_id, session_host::clients, session_host::clients_mutex, session_host::initialized, session_host::max_clients, session_host::receive_thread, session_host::receive_thread_running, session_host::render_thread, session_host::render_thread_running, session_host::running, session_host_client_t::socket, session_host::socket_v4, session_host::socket_v6, and session_host::user_data.
Referenced by session_host_destroy().
| void session_host_stop_render | ( | session_host_t * | host | ) |
Definition at line 1373 of file host.c.
References asciichat_thread_join(), session_host::audio_ctx, session_host::initialized, opus_codec_destroy(), session_host::opus_decoder, session_host::opus_encoder, session_host::render_thread, session_host::render_thread_running, and session_audio_destroy().