ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
protocol.h File Reference

ascii-chat Client Protocol Handler Interface More...

Go to the source code of this file.

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.
 

Detailed Description

ascii-chat Client Protocol Handler Interface

Defines the protocol handling interface for client-side packet processing and data reception thread management.

The protocol handler manages the data reception thread, which continuously receives packets from the server, decrypts them, and dispatches them to appropriate handlers based on packet type. It also detects connection loss and signals the main thread to initiate reconnection.

Command Types Handled

The client processes these command/packet types from the server:

  • PACKET_TYPE_ASCII_FRAME: Terminal display frame (rendered to stdout)
  • PACKET_TYPE_AUDIO_BATCH: Opus-encoded audio samples (sent to audio playback)
  • PACKET_TYPE_PONG: Keepalive response (recorded for timeout detection)
  • PACKET_TYPE_CLEAR_CONSOLE: Terminal clear command (resets display)
  • PACKET_TYPE_SERVER_STATE: Server state updates (logged for debugging)
Author
Zachary Fogg me@zf.nosp@m.o.gg
Date
2025
See also
topic_client_protocol "Protocol Architecture"

Definition in file src/client/protocol.h.