pub(crate) fn new(params: DataChannelParameters, setting_engine: Arc<SettingEngine>) -> Self {
        RTCDataChannel {
            stats_id: format!(
                "DataChannel-{}",
                SystemTime::now()
                    .duration_since(SystemTime::UNIX_EPOCH)
                    .map_or(0, |d| d.as_nanos())
            ),
            label: params.label,
            protocol: params.protocol,
            negotiated: params.negotiated,
            id: AtomicU16::new(params.id),
            ordered: params.ordered,
            max_packet_lifetime: params.max_packet_life_time,
            max_retransmits: params.max_retransmits,
            ready_state: Arc::new(AtomicU8::new(RTCDataChannelState::Connecting as u8)),
            detach_called: Arc::new(AtomicBool::new(false)),

            notify_tx: Arc::new(Notify::new()),

            setting_engine,
            ..Default::default()
        }
    }
// create the DataChannel object before the networking is set up.
create the DataChannel object before the networking is set up.
create the DataChannel object before the networking is set up .
pub(crate) fn new(params: DataChannelParameters, setting_engine: Arc<SettingEngine>) -> Self {
        RTCDataChannel {
            stats_id: format!(
                "DataChannel-{}",
                SystemTime::now()
                    .duration_since(SystemTime::UNIX_EPOCH)
                    .map_or(0, |d| d.as_nanos())
            ),
            label: params.label,
            protocol: params.protocol,
            negotiated: params.negotiated,
            id: AtomicU16::new(params.id),
            ordered: params.ordered,
            max_packet_lifetime: params.max_packet_life_time,
            max_retransmits: params.max_retransmits,
            ready_state: Arc::new(AtomicU8::new(RTCDataChannelState::Connecting as u8)),
            detach_called: Arc::new(AtomicBool::new(false)),
            notify_tx: Arc::new(Notify::new()),
            setting_engine,
            ..Default::default()
        }
    }
pub ( crate ) fn new ( params : DataChannelParameters , setting_engine : Arc < SettingEngine > ) -> Self { RTCDataChannel { stats_id : format ! ( " " SystemTime now ( ) duration_since ( SystemTime UNIX_EPOCH ) map_or ( 0 d d as_nanos ( ) ) ) , label : params . label , protocol : params . protocol , negotiated : params . negotiated , id : AtomicU16 :: new ( params . id ) , ordered : params . ordered , max_packet_lifetime : params . max_packet_life_time , max_retransmits : params . max_retransmits , ready_state : Arc :: new ( AtomicU8 :: new ( RTCDataChannelState :: Connecting as u8 ) ) , detach_called : Arc :: new ( AtomicBool :: new ( false ) ) , notify_tx : Arc :: new ( Notify :: new ( ) ) , setting_engine , .. Default :: default ( ) } }
create the DataChannel object before the networking is set up.
create the DataChannel object before the networking is set up .
params
DataChannelParameters
setting_engine
Arc<SettingEngine>