ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
webrtc_data_channel Struct Reference

When code needs to work with webrtc peer connection, it keeps mapping, port_reservation, mapping_thread, mapping_stop here instead of scattering it across globals. Initialization establishes the handles and sizes; teardown must release any allocation, lock, thread, or callback context recorded in those fields. More...

Data Fields

int rtc_id
 libdatachannel data channel ID
webrtc_peer_connection_t * pc
 Parent peer connection.
atomic_t is_open
 Channel open state.
void(* user_on_open )(webrtc_data_channel_t *dc, void *user_data)
 Open callback.
void(* user_on_close )(webrtc_data_channel_t *dc, void *user_data)
 Close callback.
void(* user_on_error )(webrtc_data_channel_t *dc, const char *error, void *user_data)
 Error callback.
void(* user_on_message )(webrtc_data_channel_t *dc, const uint8_t *data, size_t len, void *user_data)
 Message callback.
void * user_data
 User data for per-channel callbacks.

Detailed Description

When code needs to work with webrtc peer connection, it keeps mapping, port_reservation, mapping_thread, mapping_stop here instead of scattering it across globals. Initialization establishes the handles and sizes; teardown must release any allocation, lock, thread, or callback context recorded in those fields.

WebRTC data channel for sending/receiving messages

Bidirectional communication channel over a WebRTC peer connection. Supports custom per-channel callbacks for open/close/error/message events.

Definition at line 83 of file lib/network/webrtc/webrtc.c.

Field Documentation

◆ is_open

◆ pc

webrtc_peer_connection_t* webrtc_data_channel::pc

Parent peer connection.

Definition at line 85 of file lib/network/webrtc/webrtc.c.

Referenced by webrtc_create_datachannel().

◆ rtc_id

◆ user_data

void* webrtc_data_channel::user_data

User data for per-channel callbacks.

Definition at line 94 of file lib/network/webrtc/webrtc.c.

Referenced by webrtc_datachannel_set_callbacks().

◆ user_on_close

void(* webrtc_data_channel::user_on_close) (webrtc_data_channel_t *dc, void *user_data)

Close callback.

Definition at line 90 of file lib/network/webrtc/webrtc.c.

Referenced by webrtc_datachannel_set_callbacks().

◆ user_on_error

void(* webrtc_data_channel::user_on_error) (webrtc_data_channel_t *dc, const char *error, void *user_data)

Error callback.

Definition at line 91 of file lib/network/webrtc/webrtc.c.

Referenced by webrtc_datachannel_set_callbacks().

◆ user_on_message

void(* webrtc_data_channel::user_on_message) (webrtc_data_channel_t *dc, const uint8_t *data, size_t len, void *user_data)

Message callback.

Definition at line 92 of file lib/network/webrtc/webrtc.c.

Referenced by webrtc_datachannel_set_callbacks().

◆ user_on_open

void(* webrtc_data_channel::user_on_open) (webrtc_data_channel_t *dc, void *user_data)

Open callback.

Definition at line 89 of file lib/network/webrtc/webrtc.c.

Referenced by webrtc_datachannel_set_callbacks().


The documentation for this struct was generated from the following file: