|
ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
|
Transport abstraction layer for ACIP protocol. More...
Go to the source code of this file.
Data Structures | |
| struct | acip_transport_methods_t |
| Transport method table (virtual function table) More... | |
| struct | acip_transport |
| Transport instance structure. More... | |
Typedefs | |
| typedef struct acip_transport | acip_transport_t |
| Forward declaration of transport implementation. | |
Enumerations | |
| enum | acip_transport_type_t { ACIP_TRANSPORT_TCP = 1 , ACIP_TRANSPORT_WEBSOCKET = 2 , ACIP_TRANSPORT_WEBRTC = 3 , ACIP_TRANSPORT_HTTP = 4 , ACIP_TRANSPORT_QUIC = 5 } |
| Transport type enumeration. More... | |
Functions | |
| void | acip_transport_destroy (acip_transport_t *transport) |
| Destroy transport and free all resources. | |
| acip_transport_t * | acip_tcp_transport_create (socket_t sockfd, crypto_context_t *crypto_ctx) |
| Create TCP transport from existing socket. | |
| acip_transport_t * | acip_websocket_transport_create (socket_t sockfd, crypto_context_t *crypto_ctx) |
| Create WebSocket transport from existing socket. | |
| acip_transport_t * | acip_webrtc_transport_create (struct webrtc_peer_connection *peer_conn, struct webrtc_data_channel *data_channel, crypto_context_t *crypto_ctx) |
Transport abstraction layer for ACIP protocol.
Provides a transport-agnostic interface that allows ACIP protocol handlers to work with any underlying transport (TCP, WebSocket, HTTP, etc.).
Definition in file transport.h.
| typedef struct acip_transport acip_transport_t |
Forward declaration of transport implementation.
Opaque handle to transport-specific state. Each transport implementation defines its own state structure.
Definition at line 73 of file transport.h.
Transport type enumeration.
Identifies which transport implementation is being used. Useful for debugging and conditional logic.
Definition at line 59 of file transport.h.
| acip_transport_t * acip_tcp_transport_create | ( | socket_t | sockfd, |
| crypto_context_t * | crypto_ctx | ||
| ) |
Create TCP transport from existing socket.
| sockfd | Connected socket descriptor |
| crypto_ctx | Optional crypto context (may be NULL) |
Definition at line 208 of file tcp/transport.c.
References acip_transport::crypto_ctx, ERROR_INVALID_PARAM, ERROR_MEMORY, acip_transport::impl_data, INVALID_SOCKET_VALUE, tcp_transport_data_t::is_connected, log_debug, acip_transport::methods, SAFE_FREE, SAFE_MALLOC, SET_ERRNO, and tcp_transport_data_t::sockfd.
Referenced by server_connection_establish(), and server_main().
| void acip_transport_destroy | ( | acip_transport_t * | transport | ) |
Destroy transport and free all resources.
| transport | Transport to destroy (may be NULL) |
Definition at line 247 of file tcp/transport.c.
References acip_transport_methods_t::close, acip_transport_methods_t::destroy_impl, acip_transport::impl_data, acip_transport_methods_t::is_connected, log_debug, acip_transport::methods, and SAFE_FREE.
Referenced by connection_context_cleanup(), server_connection_close(), server_connection_set_transport(), and server_main().
| acip_transport_t * acip_webrtc_transport_create | ( | struct webrtc_peer_connection * | peer_conn, |
| struct webrtc_data_channel * | data_channel, | ||
| crypto_context_t * | crypto_ctx | ||
| ) |
Definition at line 374 of file webrtc/transport.c.
References ASCIICHAT_OK, cond_destroy(), cond_init(), acip_transport::crypto_ctx, webrtc_transport_data_t::data_channel, ERROR_INTERNAL, ERROR_INVALID_PARAM, ERROR_MEMORY, acip_transport::impl_data, webrtc_transport_data_t::is_connected, log_info, acip_transport::methods, mutex_destroy(), mutex_init(), webrtc_datachannel_callbacks_t::on_open, webrtc_transport_data_t::peer_conn, webrtc_transport_data_t::queue_cond, webrtc_transport_data_t::queue_mutex, webrtc_transport_data_t::recv_queue, ringbuffer_create(), ringbuffer_destroy(), SAFE_FREE, SAFE_MALLOC, SET_ERRNO, webrtc_transport_data_t::state_mutex, webrtc_datachannel_set_callbacks(), and WEBRTC_RECV_QUEUE_SIZE.
| acip_transport_t * acip_websocket_transport_create | ( | socket_t | sockfd, |
| crypto_context_t * | crypto_ctx | ||
| ) |
Create WebSocket transport from existing socket.
| sockfd | Connected socket descriptor (after WebSocket handshake) |
| crypto_ctx | Optional crypto context (may be NULL) |
Definition at line 32 of file websocket/transport.c.
References ERROR_INTERNAL, log_error, and SET_ERRNO.