63 bool has_ever_connected);
213 const uint16_t *frame_sizes,
int frame_count);
int threaded_send_pong_packet(void)
Thread-safe pong packet transmission.
void server_connection_close()
Close the server connection gracefully.
bool server_connection_is_active()
Check if server connection is currently active.
int server_send_packet(packet_type_t type, const void *data, size_t len)
Send general packet to server.
void server_connection_shutdown()
Emergency connection shutdown for signal handlers.
int server_send_terminal_capabilities(unsigned short width, unsigned short height)
Send terminal capabilities to server.
int threaded_send_terminal_size_with_auto_detect(unsigned short width, unsigned short height)
Thread-safe terminal size packet transmission with auto-detection.
int threaded_send_client_join_packet(const char *display_name, uint32_t capabilities)
Thread-safe client join packet transmission.
acip_transport_t * server_connection_get_transport(void)
Get ACIP transport instance.
int threaded_send_stream_start_packet(uint32_t stream_type)
Thread-safe stream start packet transmission.
uint32_t server_connection_get_client_id()
Get client ID assigned by server.
socket_t server_connection_get_socket()
Get current socket file descriptor.
asciichat_error_t threaded_send_audio_opus(const uint8_t *opus_data, size_t opus_size, int sample_rate, int frame_duration)
Thread-safe Opus audio frame transmission.
void server_connection_set_transport(acip_transport_t *transport)
Set ACIP transport instance from connection fallback.
void server_connection_set_ip(const char *ip)
Set the server IP address.
int threaded_send_ping_packet(void)
Thread-safe ping packet transmission.
int server_send_stream_start(uint32_t stream_type)
Send stream start notification.
bool server_connection_is_lost()
Check if connection loss has been detected.
int server_send_audio(const float *samples, int num_samples)
Send audio data to server.
int server_connection_init()
Initialize the server connection management subsystem.
asciichat_error_t threaded_send_audio_opus_batch(const uint8_t *opus_data, size_t opus_size, const uint16_t *frame_sizes, int frame_count)
Thread-safe Opus audio batch packet transmission.
int server_send_audio_batch(const float *samples, int num_samples, int batch_count)
Send batched audio data to server.
asciichat_error_t threaded_send_packet(packet_type_t type, const void *data, size_t len)
Thread-safe packet transmission.
int server_send_stream_stop(uint32_t stream_type)
Send stream stop notification.
int server_send_ping()
Send ping keepalive packet.
int threaded_send_audio_batch_packet(const float *samples, int num_samples, int batch_count)
Thread-safe batched audio packet transmission.
void server_connection_cleanup()
Cleanup connection management subsystem.
int server_send_pong()
Send pong response packet.
void server_connection_lost()
Signal that connection has been lost.
const char * server_connection_get_ip()
Get resolved server IP address.
int server_connection_establish(const char *address, int port, int reconnect_attempt, bool first_connection, bool has_ever_connected)
Establish connection to ascii-chat server.
asciichat_error_t
Error and exit codes - unified status values (0-255)
packet_type_t
Network protocol packet type enumeration.
📝 Logging API with multiple log levels and terminal output control
Packet protocol implementation with encryption and compression support.
Cross-platform socket interface for ascii-chat.
connection_error_t
Connection establishment error codes.
@ CONNECTION_ERROR_GENERIC
Generic error (retry allowed)
@ CONNECTION_ERROR_HOST_KEY_FAILED
Host key verification failed (no retry)
@ CONNECTION_SUCCESS
Connection established successfully.
@ CONNECTION_ERROR_AUTH_FAILED
Authentication failure (no retry)
@ CONNECTION_WARNING_NO_CLIENT_AUTH
Server not using client verification (warning)
Transport instance structure.