ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
main.c File Reference

Go to the source code of this file.

Functions

int acds_main (void)
 ACDS (discovery-service mode) entry point.
 

Function Documentation

◆ acds_main()

int acds_main ( void  )

ACDS (discovery-service mode) entry point.

Expects options already parsed and shared initialization complete. Called by main.c mode dispatcher after options_init() and asciichat_shared_init().

Returns
Exit code (0 = success, non-zero = error)

Definition at line 279 of file discovery-service/main.c.

279 {
281 // Required callbacks
282 .init_fn = acds_init_fn,
283 .init_user_data = NULL,
284 .interrupt_fn = acds_interrupt_fn,
285
286 // Cleanup
287 .cleanup_fn = acds_cleanup_fn,
288 .cleanup_user_data = NULL,
289
290 // No status screen for ACDS (for now)
291 .status_fn = NULL,
292 .status_user_data = NULL,
293
294 // TCP handler
295 .tcp_handler = acds_client_handler,
296 .tcp_user_data = &g_server,
297
298 // WebSocket
299 .websocket =
300 {
301 .enabled = true,
303 .user_data = &g_server,
304 },
305
306 // mDNS
307 .mdns =
308 {
309 .enabled = true,
310 .service_name = "ascii-chat-Discovery-Service",
311 .service_type = "_ascii-chat-discovery-service._tcp",
312 },
313
314 // UPnP
315 .upnp =
316 {
317 .enabled = true,
318 .description = "ascii-chat ACDS",
319 },
320
321 // System
322 .raise_fd_limit = true,
323 .fd_limit_target = 65536,
324 };
325
326 return session_server_like_run(&config);
327}
asciichat_error_t session_server_like_run(const session_server_like_config_t *config)
void * acds_websocket_client_handler(void *arg)
WebSocket client handler (thread entry point)
void * acds_client_handler(void *arg)
Per-client connection handler (thread entry point)
session_server_like_init_fn init_fn

References acds_client_handler(), acds_websocket_client_handler(), and session_server_like_run().